diff --git a/src/Pages/BookingScreen/Components/UtillComponents/ProductPriceChange.jsx b/src/Pages/BookingScreen/Components/UtillComponents/ProductPriceChange.jsx index 2e20526..c9f35a6 100644 --- a/src/Pages/BookingScreen/Components/UtillComponents/ProductPriceChange.jsx +++ b/src/Pages/BookingScreen/Components/UtillComponents/ProductPriceChange.jsx @@ -1,518 +1,449 @@ -import { shallowEqual, useSelector } from 'react-redux'; -import { - GlobalAccessForOthers, - GlobalCardAccess, - GlobalCombosearch, - GlobalItemCard, - GlobalProductCategorie, - GlobalSelectedDatas, - GlobalWithoutSubCatItemCard, - triggerProductCard, -} from '../../../../Features/BookingScreen/BookingData/BookingData'; -import { DefaultModal } from '../../../../Components/Modal/DefaultModal'; -import { useCallback, useEffect, useRef, useState } from 'react'; -import { Tables } from '../../../../Components/Tables/Table'; -import { InputField } from '../../../../Components/Forms/InputField'; -import { Form, Pagination, Tooltip } from 'antd'; -import { getSession } from '../../../../Services/Others'; -import { Messages } from '../../../../Components/Notifications/Messages'; -import { useDispatch } from 'react-redux'; -import { PutStockPrice } from '../../../../Features/StockPriceUpdate/StockPriceUpdateMaster'; -import PriceChange from '../../../../Images/PayOptImgs/PriceChange.svg'; +import { shallowEqual, useSelector } from "react-redux"; +import { GlobalAccessForOthers, GlobalCardAccess, GlobalCombosearch, GlobalItemCard, GlobalProductCategorie, GlobalSelectedDatas, GlobalWithoutSubCatItemCard, triggerProductCard } from "../../../../Features/BookingScreen/BookingData/BookingData"; +import { DefaultModal } from "../../../../Components/Modal/DefaultModal"; +import { useCallback, useEffect, useRef, useState } from "react"; +import { Tables } from "../../../../Components/Tables/Table"; +import { InputField } from "../../../../Components/Forms/InputField"; +import { Form, Pagination, Tooltip } from "antd"; +import { getSession } from "../../../../Services/Others"; +import { Messages } from "../../../../Components/Notifications/Messages"; +import { useDispatch } from "react-redux"; +import { PutStockPrice } from "../../../../Features/StockPriceUpdate/StockPriceUpdateMaster"; +import PriceChange from "../../../../Images/PayOptImgs/PriceChange.svg" -const ProductPriceChange = ({ - showButton = true, - priceChangeProduct = [], - productPriceChange = false, - setProductPriceChange = () => {}, - setPriceChangeProduct = () => {}, -}) => { - const formRef = useRef(null); - const dispatch = useDispatch(); +const ProductPriceChange = ({ showButton = true, priceChangeProduct = null, productPriceChange = false, setProductPriceChange = () => { }, setPriceChangeProduct = () => { } }) => { - const AppId = getSession('AppId'); - const CompId = getSession('CompId'); - const BranchId = getSession('BranchId'); - const UserId = getSession('UserId'); + const formRef = useRef(null); + const dispatch = useDispatch(); - const [messageData, setMessageData] = useState(null); - const [messageType, setMessageType] = useState(null); - const [currentPage, setCurrentPage] = useState(1); - const [pageSize] = useState(10); + const AppId = getSession('AppId'); + const CompId = getSession('CompId'); + const BranchId = getSession('BranchId'); + const UserId = getSession('UserId'); - const [noSubcatCardData, setNoSubcatCardData] = useState(); - const [priceChangeModal, setPriceChangeModal] = useState(false); + const [messageData, setMessageData] = useState(null); + const [messageType, setMessageType] = useState(null); + const [currentPage, setCurrentPage] = useState(1); + const [pageSize] = useState(10); - const comboSearch = useSelector(GlobalCombosearch); - const ProdCat = useSelector(GlobalProductCategorie, shallowEqual); - const ItemCard = useSelector(GlobalItemCard, shallowEqual); - const withoutSubCatItemCard = useSelector( - GlobalWithoutSubCatItemCard, - shallowEqual - ); - const CardAccess = useSelector(GlobalCardAccess, shallowEqual); - const globalAccessForOthers = useSelector( - GlobalAccessForOthers, - shallowEqual - ); - const SelectedDatas = useSelector(GlobalSelectedDatas, shallowEqual); - const [tableData, setTableData] = useState([]); - const [editingKey, setEditingKey] = useState(null); - const [priceChangedProducts, setPriceChangedProducts] = useState([]); - console.log(comboSearch, 'comboSearch'); + const [noSubcatCardData, setNoSubcatCardData] = useState(); + const [priceChangeModal, setPriceChangeModal] = useState(false); - // console.log(noSubcatCardData, "noSubcatCardData") + const comboSearch = useSelector(GlobalCombosearch); + const ProdCat = useSelector(GlobalProductCategorie, shallowEqual); + const ItemCard = useSelector(GlobalItemCard, shallowEqual); + const withoutSubCatItemCard = useSelector(GlobalWithoutSubCatItemCard, shallowEqual); + const CardAccess = useSelector(GlobalCardAccess, shallowEqual); + const globalAccessForOthers = useSelector(GlobalAccessForOthers, shallowEqual); + const SelectedDatas = useSelector(GlobalSelectedDatas, shallowEqual); + const [tableData, setTableData] = useState([]); + const [editingKey, setEditingKey] = useState(null); + const [priceChangedProducts, setPriceChangedProducts] = useState([]); + console.log(comboSearch, "comboSearch") - useEffect(() => { - if ( - ProdCat && - (ItemCard || withoutSubCatItemCard) && - (!noSubcatCardData || noSubcatCardData?.length === 0) - ) { - setNoSubcatCardData( - ItemCard?.length === 0 ? withoutSubCatItemCard : ItemCard - ); - } - }, [ProdCat, ItemCard, withoutSubCatItemCard, noSubcatCardData]); + // console.log(noSubcatCardData, "noSubcatCardData") - const priceChangeColumns = [ - { - title: 'S.No', - dataIndex: 'SlNo', - key: 'SlNo', - width: '60px', - align: 'center', - render: (text, record, index) => ( -
{(currentPage - 1) * pageSize + index + 1}
- ), - }, - { - title: 'Product Name', - dataIndex: 'ProdName', - key: 'ProdName', - }, - { - title: 'Old MRP', - dataIndex: 'MRP', - key: 'MRP', - width: '100px', - align: 'right', - }, - { - title: 'New MRP (Optional)', - dataIndex: 'NewMRP', - key: 'NewMRP', - width: '100px', - align: 'right', - render: (text, record, index) => { - // if (index === editingKey) { + useEffect(() => { + if (ProdCat && (ItemCard || withoutSubCatItemCard) && (!noSubcatCardData || noSubcatCardData?.length === 0)) { + setNoSubcatCardData(ItemCard?.length === 0 ? withoutSubCatItemCard : ItemCard); + } + }, [ProdCat, ItemCard, withoutSubCatItemCard, noSubcatCardData]); - // } - // return
{text ? text : 'Enter New MRP'}
- return ( - { - if (value === '') { - return Promise.resolve(); - } else if (parseFloat(value) < 1) { - return Promise.reject(`MRP should be greater than 0`); - } - return Promise.resolve(); - }, - }, - ]} - > - handleNewMRPChange(e?.target?.value, index)} - inputMode="decimal" - onInput={(e) => { - let cleanedValue = e.target.value.replace(/[^0-9.]/g, ''); // Remove invalid characters - const parts = cleanedValue.split('.'); + const priceChangeColumns = [ + { + title: 'S.No', + dataIndex: 'SlNo', + key: 'SlNo', + width: '60px', + align: 'center', + render: (text, record, index) =>
{(currentPage - 1) * pageSize + index + 1}
+ }, + { + title: 'Product Name', + dataIndex: 'ProdName', + key: 'ProdName', + }, + { + title: 'Old MRP', + dataIndex: 'MRP', + key: 'MRP', + width: '100px', + align: 'right', + }, + { + title: 'New MRP (Optional)', + dataIndex: 'NewMRP', + key: 'NewMRP', + width: '100px', + align: 'right', + render: (text, record, index) => { + // if (index === editingKey) { - if (cleanedValue.startsWith('.')) { - cleanedValue = '0' + cleanedValue; - } + // } + // return
{text ? text : 'Enter New MRP'}
+ return ( + { + if (value === '') { + return Promise.resolve(); + } else if (parseFloat(value) < 1) { + return Promise.reject(`MRP should be greater than 0`) + } + return Promise.resolve(); + }, + }, + ]}> + handleNewMRPChange(e?.target?.value, index)} + inputMode="decimal" + onInput={(e) => { + let cleanedValue = e.target.value.replace( + /[^0-9.]/g, + '' + ); // Remove invalid characters + const parts = cleanedValue.split('.'); - e.target.value = - parts.length > 2 - ? `${parts[0]}.${parts.slice(1).join('')}` - : cleanedValue; - }} - /> - - ); - }, - }, - { - title: 'Old Sell Price', - dataIndex: 'SellPrice', - key: 'SellPrice', - width: '120px', - align: 'right', - }, - { - title: 'New Sell Price', - dataIndex: 'NewSellPrice', - key: 'NewSellPrice', - width: '160px', - align: 'right', - render: (text, record, index) => { - // if (index === editingKey) { + if (cleanedValue.startsWith('.')) { + cleanedValue = '0' + cleanedValue; + } - // } - // return
{text ? text : 'Enter New Sell Price'}
- return ( - { - if (value === '') { - return Promise.resolve(); - } else if (parseFloat(value) < 1) { - return Promise.reject( - `Sell Price should be greater than 0` - ); - } - return Promise.resolve(); - }, - }, - ]} - > - - handleNewSellPriceChange(e?.target?.value, index) - } - inputMode="decimal" - onInput={(e) => { - let cleanedValue = e.target.value.replace(/[^0-9.]/g, ''); // Remove invalid characters - const parts = cleanedValue.split('.'); + e.target.value = + parts.length > 2 + ? `${parts[0]}.${parts.slice(1).join('')}` + : cleanedValue; + }} + /> + + ); + }, + }, + { + title: 'Old Sell Price', + dataIndex: 'SellPrice', + key: 'SellPrice', + width: '120px', + align: 'right', + }, + { + title: 'New Sell Price', + dataIndex: 'NewSellPrice', + key: 'NewSellPrice', + width: '160px', + align: 'right', + render: (text, record, index) => { + // if (index === editingKey) { - if (cleanedValue.startsWith('.')) { - cleanedValue = '0' + cleanedValue; - } + // } + // return
{text ? text : 'Enter New Sell Price'}
+ return ( + { + if (value === '') { + return Promise.resolve(); + } else if (parseFloat(value) < 1) { + return Promise.reject(`Sell Price should be greater than 0`) + } + return Promise.resolve(); + }, + }, + ]} + > + handleNewSellPriceChange(e?.target?.value, index)} + inputMode="decimal" + onInput={(e) => { + let cleanedValue = e.target.value.replace( + /[^0-9.]/g, + '' + ); // Remove invalid characters + const parts = cleanedValue.split('.'); - e.target.value = - parts.length > 2 - ? `${parts[0]}.${parts.slice(1).join('')}` - : cleanedValue; - }} - /> - - ); - }, - }, - ]; + if (cleanedValue.startsWith('.')) { + cleanedValue = '0' + cleanedValue; + } - const cardData = !globalAccessForOthers - ? CardAccess - ? SelectedDatas?.length > 1 - ? SelectedDatas - : SelectedDatas?.[0]?.AppId === 0 && SelectedDatas?.[0]?.CompId === 0 - ? [] - : SelectedDatas - : ItemCard?.length === 0 || - (ItemCard?.[0]?.AppId === 0 && ItemCard?.[0]?.CompId === 0) - ? noSubcatCardData - : ItemCard - : []; + e.target.value = + parts.length > 2 + ? `${parts[0]}.${parts.slice(1).join('')}` + : cleanedValue; + }} + /> +
+ ); + }, + }, + ]; - console.log(cardData, 'noSubcatCardDatanoSubcatCardData', ItemCard); + const cardData = !globalAccessForOthers + ? CardAccess + ? SelectedDatas?.length > 1 + ? SelectedDatas + : SelectedDatas?.[0]?.AppId === 0 && SelectedDatas?.[0]?.CompId === 0 + ? [] + : SelectedDatas + : ItemCard?.length === 0 || (ItemCard?.[0]?.AppId === 0 && ItemCard?.[0]?.CompId === 0) + ? noSubcatCardData + : ItemCard + : ''; - useEffect(() => { - if (priceChangeModal || productPriceChange) { - const extractStockDtls = (data) => { - if (data?.length === 0 || !data) return []; + console.log(cardData, "noSubcatCardDatanoSubcatCardData", ItemCard) - let stockDtls = []; + useEffect(() => { + const extractStockDtls = (data) => { + if (data?.length === 0) return []; - data?.forEach((item) => { - let products = item?.ProductDetail?.flatMap((product) => product); + let stockDtls = []; - let variants = products?.flatMap( - (product) => product?.ProdVariantDetails - ); - const filteredVariants = variants?.filter( - (variant) => variant?.StockDetails?.length > 0 - ); - const stocks = filteredVariants?.flatMap((variant) => - variant?.StockDetails?.map((stock) => ({ - ...stock, - ProdName: - products?.[0]?.ProdName + - (variant?.ProdVariantName - ? ` (${variant?.ProdVariantName})` - : ''), - StockAvailable: products?.[0]?.StockAvailable, - ProdVariantName: variant?.ProdVariantName, - })) - ); + data?.forEach(item => { + let products = item?.ProductDetail?.flatMap(product => product); - stockDtls.push( - ...stocks?.filter((stock) => - stock?.StockAvailable === 'Y' ? stock?.BatchRef : true - ) - ); - }); - console.log('extractStockDtls', stockDtls); - return stockDtls; - }; - setTableData(extractStockDtls(priceChangeProduct || cardData || [])); - setCurrentPage(1); - } - }, [cardData, priceChangeProduct, priceChangeModal, productPriceChange]); + let variants = products?.flatMap(product => product?.ProdVariantDetails); + const filteredVariants = variants?.filter(variant => variant?.StockDetails?.length > 0); + const stocks = filteredVariants?.flatMap(variant => + variant?.StockDetails?.map(stock => ({ + ...stock, + ProdName: products?.[0]?.ProdName + (variant?.ProdVariantName ? ` (${variant?.ProdVariantName})` : ''), + StockAvailable: products?.[0]?.StockAvailable, + ProdVariantName: variant?.ProdVariantName + })) + ); - const handleNewMRPChange = (value, index) => { - const updatedTableData = [...tableData]; - updatedTableData[index].NewMRP = value; - setTableData(updatedTableData); - updatedTableData[index].NewSellPrice = null; - formRef.current.setFieldsValue({ - [`NewMRP${index}`]: value, - [`NewSellPrice${index}`]: null, - }); + stockDtls.push(...stocks?.filter(stock => + stock?.StockAvailable === 'Y' + ? stock?.BatchRef + : true + )); - const priceChangedProdList = [...priceChangedProducts]; - const prodIndex = priceChangedProdList?.findIndex( - (prod) => prod?.InwardDtlId === updatedTableData[index]?.InwardDtlId - ); - if (prodIndex !== -1) { - priceChangedProdList[prodIndex] = { - ...priceChangedProdList?.[prodIndex], - NewMRP: value, - NewSellPrice: null, - }; - } - setPriceChangedProducts(priceChangedProdList); - }; + }); + console.log("extractStockDtls", stockDtls); + return stockDtls; + } + setTableData(extractStockDtls(priceChangeProduct || cardData)) + setCurrentPage(1) + }, [cardData, priceChangeProduct]) - const handleNewSellPriceChange = (value, index) => { - const updatedTableData = [...tableData]; - if (updatedTableData[index]?.NewMRP) { - if (parseFloat(value) > parseFloat(updatedTableData[index]?.NewMRP)) { - setMessageType('error'); - setMessageData('New Sell Price cannot be greater than New MRP'); - formRef.current.setFieldsValue({ - [`NewSellPrice${index}`]: null, - }); - updatedTableData[index].NewSellPrice = null; + const handleNewMRPChange = (value, index) => { + + const updatedTableData = [...tableData]; + updatedTableData[index].NewMRP = value; setTableData(updatedTableData); - const priceChangedProdList = [...priceChangedProducts]; - const prodIndex = priceChangedProdList?.findIndex( - (prod) => prod?.InwardDtlId === updatedTableData[index]?.InwardDtlId - ); + updatedTableData[index].NewSellPrice = null; + formRef.current.setFieldsValue({ + [`NewMRP${index}`]: value, + [`NewSellPrice${index}`]: null, + }); + const priceChangedProdList = [...priceChangedProducts]; + const prodIndex = priceChangedProdList?.findIndex(prod => prod?.InwardDtlId === updatedTableData[index]?.InwardDtlId); if (prodIndex !== -1) { - priceChangedProdList.splice(prodIndex, 1); + priceChangedProdList[prodIndex] = { + ...priceChangedProdList?.[prodIndex], + NewMRP: value, + NewSellPrice: null, + }; } setPriceChangedProducts(priceChangedProdList); - return; - } - } - if (!updatedTableData[index]?.NewMRP && updatedTableData[index]?.MRP) { - if (parseFloat(value) > parseFloat(updatedTableData[index]?.MRP)) { - setMessageType('error'); - setMessageData('New Sell Price cannot be greater than MRP'); - formRef.current.setFieldsValue({ - [`NewSellPrice${index}`]: null, - }); - updatedTableData[index].NewSellPrice = null; - setTableData(updatedTableData); - const priceChangedProdList = [...priceChangedProducts]; - const prodIndex = priceChangedProdList?.findIndex( - (prod) => prod?.InwardDtlId === updatedTableData[index]?.InwardDtlId - ); - - if (prodIndex !== -1) { - priceChangedProdList.splice(prodIndex, 1); - } - setPriceChangedProducts(priceChangedProdList); - return; - } - } - updatedTableData[index].NewSellPrice = value; - setTableData(updatedTableData); - formRef.current.setFieldsValue({ - [`NewSellPrice${index}`]: value, - }); - - const priceChangedProdList = [...priceChangedProducts]; - const prodIndex = priceChangedProdList?.findIndex( - (prod) => prod?.InwardDtlId === updatedTableData[index]?.InwardDtlId - ); - - if (prodIndex !== -1) { - priceChangedProdList[prodIndex] = { - ...priceChangedProdList[prodIndex], - SellPrice: String(value), - }; - } else { - priceChangedProdList.push({ - ProdId: updatedTableData[index]?.ProdId, - ProdName: updatedTableData[index]?.ProdName, - MRP: String( - updatedTableData[index]?.NewMRP || updatedTableData[index]?.MRP - ), - SellPrice: String(value), - AdjComment: 'string', - InwardDtlId: updatedTableData[index]?.InwardDtlId, - }); } - setPriceChangedProducts(priceChangedProdList); - }; + const handleNewSellPriceChange = (value, index) => { + const updatedTableData = [...tableData]; + if (updatedTableData[index]?.NewMRP) { + if (parseFloat(value) > parseFloat(updatedTableData[index]?.NewMRP)) { + setMessageType('error'); + setMessageData('New Sell Price cannot be greater than New MRP'); + formRef.current.setFieldsValue({ + [`NewSellPrice${index}`]: null, + }); + updatedTableData[index].NewSellPrice = null; + setTableData(updatedTableData); + const priceChangedProdList = [...priceChangedProducts]; + const prodIndex = priceChangedProdList?.findIndex(prod => prod?.InwardDtlId === updatedTableData[index]?.InwardDtlId); - const edit = (record, index) => { - console.log('edit', record, index); - setEditingKey(index); - }; - - const handleSubmit = async () => { - console.log('submit'); - - if (priceChangedProducts?.length > 0) { - console.log('priceChangedProducts', priceChangedProducts); - const validation = priceChangedProducts?.every((prod) => { - if (parseFloat(prod?.MRP) < parseFloat(prod?.SellPrice)) { - setMessageType('error'); - setMessageData( - `${prod?.ProdName}: MRP cannot be less than Sell Price` - ); - return false; - } - if (!parseFloat(prod?.SellPrice) || !parseFloat(prod?.MRP)) { - setMessageType('error'); - setMessageData(`${prod?.ProdName}: Please give Sell Price or MRP`); - return false; - } - return true; - }); - if (!validation) return; - - const data = { - AppId: AppId, - CompId: CompId, - BranchId: BranchId, - ProductDetails: priceChangedProducts, - UpdatedBy: UserId, - }; - - const res = await dispatch(PutStockPrice(data))?.unwrap(); - if (res?.data?.statusCode === 1) { - setMessageData('Price Changed Successfully'); - setMessageType('success'); - setPriceChangeModal(false); - setProductPriceChange(false); - setEditingKey(null); - setPriceChangedProducts([]); - setTableData([]); - dispatch(triggerProductCard()); - setPriceChangeProduct(null); - formRef.current.resetFields(); - } else { - setMessageData('Error Updating Product Price'); - setMessageType('error'); - } - } else { - setMessageType('error'); - setMessageData('No changes made / No sell price entered'); - } - }; - - const onComplete = useCallback(() => { - setMessageData(null); - setMessageType(null); - }, []); - - return ( - <> - - {showButton ? ( - - - - ) : ( - <> - )} - { - setPriceChangeModal(false); - setProductPriceChange(false); - setEditingKey(null); - setPriceChangedProducts([]); - formRef?.current?.resetFields(); - setPriceChangeProduct(null); - }} - handleSubmit={handleSubmit} - > -
- {/*
Note : Click on a row to edit/modify
*/} -
- ({ - onClick: () => { - edit(record, index); - }, - })} - /> -
- setCurrentPage(page)} - showSizeChanger={false} - showTotal={(total, range) => - `${range[0]}-${range[1]} of ${total} items` - } - /> -
- -
-
- - ); -}; + } + } + if (!updatedTableData[index]?.NewMRP && updatedTableData[index]?.MRP) { + if (parseFloat(value) > parseFloat(updatedTableData[index]?.MRP)) { + setMessageType('error'); + setMessageData('New Sell Price cannot be greater than MRP'); + formRef.current.setFieldsValue({ + [`NewSellPrice${index}`]: null, + }); + updatedTableData[index].NewSellPrice = null; + setTableData(updatedTableData); + const priceChangedProdList = [...priceChangedProducts]; + const prodIndex = priceChangedProdList?.findIndex(prod => prod?.InwardDtlId === updatedTableData[index]?.InwardDtlId); -export default ProductPriceChange; + if (prodIndex !== -1) { + priceChangedProdList.splice(prodIndex, 1); + } + setPriceChangedProducts(priceChangedProdList); + return; + } + } + updatedTableData[index].NewSellPrice = value; + setTableData(updatedTableData); + formRef.current.setFieldsValue({ + [`NewSellPrice${index}`]: value, + }); + + const priceChangedProdList = [...priceChangedProducts]; + const prodIndex = priceChangedProdList?.findIndex(prod => prod?.InwardDtlId === updatedTableData[index]?.InwardDtlId); + + if (prodIndex !== -1) { + priceChangedProdList[prodIndex] = { + ...priceChangedProdList[prodIndex], + SellPrice: String(value) + }; + } else { + priceChangedProdList.push({ + ProdId: updatedTableData[index]?.ProdId, + ProdName: updatedTableData[index]?.ProdName, + MRP: String(updatedTableData[index]?.NewMRP || updatedTableData[index]?.MRP), + SellPrice: String(value), + AdjComment: "string", + InwardDtlId: updatedTableData[index]?.InwardDtlId + }); + } + + setPriceChangedProducts(priceChangedProdList); + } + + const edit = (record, index) => { + console.log("edit", record, index); + setEditingKey(index); + } + + const handleSubmit = async () => { + console.log("submit"); + + if (priceChangedProducts?.length > 0) { + console.log("priceChangedProducts", priceChangedProducts); + const validation = priceChangedProducts?.every((prod) => { + if (parseFloat(prod?.MRP) < parseFloat(prod?.SellPrice)) { + setMessageType('error'); + setMessageData(`${prod?.ProdName}: MRP cannot be less than Sell Price`); + return false; + } + if (!parseFloat(prod?.SellPrice) || !parseFloat(prod?.MRP)) { + setMessageType('error'); + setMessageData(`${prod?.ProdName}: Please give Sell Price or MRP`); + return false; + } + return true; + }); + if (!validation) return; + + const data = { + AppId: AppId, + CompId: CompId, + BranchId: BranchId, + ProductDetails: priceChangedProducts, + UpdatedBy: UserId, + } + + const res = await dispatch(PutStockPrice(data))?.unwrap(); + if (res?.data?.statusCode === 1) { + setMessageData('Price Changed Successfully'); + setMessageType('success'); + setPriceChangeModal(false); + setProductPriceChange(false); + setEditingKey(null); + setPriceChangedProducts([]); + setTableData([]); + dispatch(triggerProductCard()) + setPriceChangeProduct(null); + formRef.current.resetFields(); + } else { + setMessageData('Error Updating Product Price') + setMessageType('error'); + } + } else { + setMessageType('error'); + setMessageData('No changes made / No sell price entered'); + } + + } + + const onComplete = useCallback(() => { + setMessageData(null); + setMessageType(null); + }, []) + + return ( + <> + + + {showButton ? + + : <>} + { + setPriceChangeModal(false); + setProductPriceChange(false); + setEditingKey(null); + setPriceChangedProducts([]); + formRef?.current?.resetFields(); + setPriceChangeProduct(null); + }} + handleSubmit={handleSubmit} + > +
+ {/*
Note : Click on a row to edit/modify
*/} +
+ ({ + onClick: () => { + edit(record, index); + }, + })} + /> +
+ setCurrentPage(page)} + showSizeChanger={false} + showTotal={(total, range) => `${range[0]}-${range[1]} of ${total} items`} + /> +
+ +
+
+ + ) +} + +export default ProductPriceChange; \ No newline at end of file diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle11.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle11.jsx index b12c765..0d6de8f 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle11.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle11.jsx @@ -104,6 +104,7 @@ const PrintStyle11 = ({ const GlobalCashierName = useSelector(GlobalprintCashierName); const GlobalLogo = useSelector(GlobalprintLogo); const GlobalCredit = useSelector(GlobalprintCredit); + const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor); const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find( (setting) => @@ -350,8 +351,8 @@ const PrintStyle11 = ({ flexDirection: 'column', justifyContent: chunkIndex === paginatedChunks.length - 1 && - !shouldFooterBeOnNewPage && - FormatTheme + !shouldFooterBeOnNewPage && + FormatTheme ? 'space-between' : '', height: isMobile @@ -392,7 +393,7 @@ const PrintStyle11 = ({ /> ) : null} {base64Image && - (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( + (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} @@ -422,18 +423,18 @@ const PrintStyle11 = ({ {GlobaldummyData ? 'BranchAddress, Town- 635XXX City - State' : (table2Data?.AddressDetails?.[0]?.Address1 || '') + - (table2Data?.AddressDetails?.[0]?.City - ? (table2Data?.AddressDetails?.[0]?.Address1 && - table2Data?.AddressDetails?.[0]?.City - ? '-' - : '') + table2Data?.AddressDetails?.[0]?.City - : '') + - (table2Data?.AddressDetails?.[0]?.Zip - ? (table2Data?.AddressDetails?.[0]?.City && - table2Data?.AddressDetails?.[0]?.Zip - ? '-' - : '') + table2Data?.AddressDetails?.[0]?.Zip - : '')} + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')}
{' '} @@ -473,10 +474,10 @@ const PrintStyle11 = ({ {GlobaldummyData ? '553' : table2Data?.OrderId && - extractLastNumberOrderId( - table2Data?.OrderId, - table2Data?.FYStatus - )} + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}
)} @@ -518,121 +519,121 @@ const PrintStyle11 = ({ {GlobaldummyData ? GlobalSlNo && ( - S.N - ) + S.N + ) : SLNO && S.N} {GlobaldummyData ? GlobalItem && ( - Item - ) + Item + ) : Item && Item} {GlobaldummyData ? GlobalQuantity && ( - - Qty - - ) + + Qty + + ) : Quantity && ( - - {' '} - {WeightasKg ? 'Qty/Kg' : 'Qty'} - - )} + + {' '} + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - HSN - - ) + + HSN + + ) : HsnCode && ( - - HSN - - )} + + HSN + + )} {GlobaldummyData ? GlobalMRP && ( - - MRP - - ) + + MRP + + ) : MRP && ( - - MRP - - )} + + MRP + + )} {GlobaldummyData ? GlobalDiscount && ( - - Dis{' '} - - ) + + Dis{' '} + + ) : Discount && ( - - Dis{' '} - - )} + + Dis{' '} + + )} {GlobaldummyData ? GlobalTax && ( - - Tax %{' '} - - ) + + Tax %{' '} + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - Tax %{' '} - - )} + table2Data?.OrderType !== 'E' && ( + + Tax %{' '} + + )} {GlobaldummyData ? GlobalRate && ( - - Rate - - ) + + Rate + + ) : Rate && ( - - Rate - - )} + + Rate + + )} {GlobaldummyData ? GlobalAmount && ( - - Amt - - ) + + Amt + + ) : Amount && ( - - Amt - - )} + + Amt + + )} @@ -642,207 +643,207 @@ const PrintStyle11 = ({ {GlobaldummyData ? GlobalSlNo && {index + 1} : SLNO && ( - - {chunkIndex * chunkSize + index + 1} - - )} + + {chunkIndex * chunkSize + index + 1} + + )} {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item && ( - -
{item?.ProdName}
- {PackageDetails?.filter( - (pkg) => pkg.ProdId === item.ProdId - ).length > 0 ? ( -
- {PackageDetails?.filter( - (pkg) => pkg.ProdId === item.ProdId - )?.map((item, index) => ( - - {item.ParcelCount} PCS{' '} - {item.ParcelQty} PACK ( - {item.ParcelType}) - - ))} - {item?.BrandName !== null - ? item?.BrandName - : ''} -   - {item?.ProductIdentifierDtls?.length > + +
{item?.ProdName}
+ {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + ).length > 0 ? ( +
+ {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + )?.map((item, index) => ( + + {item.ParcelCount} PCS{' '} + {item.ParcelQty} PACK ( + {item.ParcelType}) + + ))} + {item?.BrandName !== null + ? item?.BrandName + : ''} +   + {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls?.filter( - (items) => - !( - items.SerialNumber == '' || - items.SerialNumber == null - ) - )?.map((a) => { - return ( -
{a.SerialNumber}
- ); - }) - : ''}{' '} - {item?.ProductIdentifierDtls?.length > + ? item?.ProductIdentifierDtls?.filter( + (items) => + !( + items.SerialNumber == '' || + items.SerialNumber == null + ) + )?.map((a) => { + return ( +
{a.SerialNumber}
+ ); + }) + : ''}{' '} + {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (item1) => - item1.IMEI1 !== '' || - item1.IMEI2 !== '' - )?.map((item2) => { - const imei1 = item2.IMEI1 || ''; - const imei2 = item2.IMEI2 || ''; - return ( -
- {[imei1, imei2] - .filter(Boolean) - .join(',')} -
- ); - }) - : ''} -
- ) : ( -
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) - {item?.BrandName !== null - ? item?.BrandName - : ''} -   - {item?.ProductIdentifierDtls?.length > + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) + : ''} +
+ ) : ( +
+ ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) + {item?.BrandName !== null + ? item?.BrandName + : ''} +   + {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls?.filter( - (items) => - !( - items.SerialNumber == '' || - items.SerialNumber == null - ) - )?.map((a) => { - return ( -
{a.SerialNumber}
- ); - }) - : ''}{' '} - {item?.ProductIdentifierDtls?.length > + ? item?.ProductIdentifierDtls?.filter( + (items) => + !( + items.SerialNumber == '' || + items.SerialNumber == null + ) + )?.map((a) => { + return ( +
{a.SerialNumber}
+ ); + }) + : ''}{' '} + {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (item1) => - item1.IMEI1 !== '' || - item1.IMEI2 !== '' - )?.map((item2) => { - const imei1 = item2.IMEI1 || ''; - const imei2 = item2.IMEI2 || ''; - return ( -
- {[imei1, imei2] - .filter(Boolean) - .join(',')} -
- ); - }) - : ''} -
- )} - - )} + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) + : ''} +
+ )} + + )} {GlobaldummyData ? GlobalQuantity && ( - - {item?.SalesQty} - - ) + + {item?.SalesQty} + + ) : Quantity && ( - - {item?.SalesQty} - - )} + + {item?.SalesQty} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - - ) + + {item?.HSN} + + ) : HsnCode && ( - - {item?.HSN} - - )} + + {item?.HSN} + + )} {GlobaldummyData ? GlobalMRP && ( - - {item?.MRP} - - ) + + {item?.MRP} + + ) : MRP && ( - - {item?.SinglePc === 'Y' - ? item?.Rate - : item?.MRP} - - )} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + )} {GlobaldummyData ? GlobalDiscount && ( - - {item.discount} - - ) + + {item.discount} + + ) : Discount && ( - - {item?.Type != 'C' - ? item?.OfferAmt || 0 - : item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} {GlobaldummyData ? GlobalTax && ( - - {item.ProdTaxPercentage} - - ) + + {item.ProdTaxPercentage} + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - {item?.ProdTaxPercentage || 0} - - )} + table2Data?.OrderType !== 'E' && ( + + {item?.ProdTaxPercentage || 0} + + )} {GlobaldummyData ? GlobalRate && ( - - {item?.Rate} - - ) + + {item?.Rate} + + ) : Rate && ( - - {item?.Rate} - - )} + + {item?.Rate} + + )} {GlobaldummyData ? GlobalAmount && ( - - {item?.TotalAmt} - - ) + + {item?.TotalAmt} + + ) : Amount && ( - - {item?.Type != 'C' - ? item?.TotalAmt - item?.OfferAmt || 0 - : item?.TotalAmt - item?.OfferValue || - 0} - - )} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || + 0} + + )} ); })} @@ -870,121 +871,121 @@ const PrintStyle11 = ({ {GlobaldummyData ? GlobalSlNo && ( - S.N - ) + S.N + ) : SLNO && S.N} {GlobaldummyData ? GlobalItem && ( - Item - ) + Item + ) : Item && Item} {GlobaldummyData ? GlobalQuantity && ( - - Qty - - ) + + Qty + + ) : Quantity && ( - - {' '} - {WeightasKg ? 'Qty/Kg' : 'Qty'} - - )} + + {' '} + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - HSN - - ) + + HSN + + ) : HsnCode && ( - - HSN - - )} + + HSN + + )} {GlobaldummyData ? GlobalMRP && ( - - MRP - - ) + + MRP + + ) : MRP && ( - - MRP - - )} + + MRP + + )} {GlobaldummyData ? GlobalDiscount && ( - - Dis{' '} - - ) + + Dis{' '} + + ) : Discount && ( - - Dis{' '} - - )} + + Dis{' '} + + )} {GlobaldummyData ? GlobalTax && ( - - Tax %{' '} - - ) + + Tax %{' '} + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - Tax %{' '} - - )} + table2Data?.OrderType !== 'E' && ( + + Tax %{' '} + + )} {GlobaldummyData ? GlobalRate && ( - - Rate - - ) + + Rate + + ) : Rate && ( - - Rate - - )} + + Rate + + )} {GlobaldummyData ? GlobalAmount && ( - - Amt - - ) + + Amt + + ) : Amount && ( - - Amt - - )} + + Amt + + )} @@ -994,116 +995,116 @@ const PrintStyle11 = ({ {GlobaldummyData ? GlobalSlNo && {index + 1} : SLNO && ( - - {chunkIndex * chunkSize + index + 1} - - )} + + {chunkIndex * chunkSize + index + 1} + + )} {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item && ( - -
{item?.ProdName}
-
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) -
- - )} + +
{item?.ProdName}
+
+ ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) +
+ + )} {GlobaldummyData ? GlobalQuantity && ( - - {item?.SalesQty} - - ) + + {item?.SalesQty} + + ) : Quantity && ( - - {item?.SalesQty} - - )} + + {item?.SalesQty} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - - ) + + {item?.HSN} + + ) : HsnCode && ( - - {item?.HSN} - - )} + + {item?.HSN} + + )} {GlobaldummyData ? GlobalMRP && ( - - {item?.MRP} - - ) + + {item?.MRP} + + ) : MRP && ( - - {item?.SinglePc === 'Y' - ? item?.Rate - : item?.MRP} - - )} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + )} {GlobaldummyData ? GlobalDiscount && ( - - {item.discount} - - ) + + {item.discount} + + ) : Discount && ( - - {item?.Type != 'C' - ? item?.OfferAmt || 0 - : item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} {GlobaldummyData ? GlobalTax && ( - - {item.ProdTaxPercentage} - - ) + + {item.ProdTaxPercentage} + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - {item?.ProdTaxPercentage || 0} - - )} + table2Data?.OrderType !== 'E' && ( + + {item?.ProdTaxPercentage || 0} + + )} {GlobaldummyData ? GlobalRate && ( - - {item?.Rate} - - ) + + {item?.Rate} + + ) : Rate && ( - - {item?.Rate} - - )} + + {item?.Rate} + + )} {GlobaldummyData ? GlobalAmount && ( - - {item?.TotalAmt} - - ) + + {item?.TotalAmt} + + ) : Amount && ( - - {item?.Type != 'C' - ? item?.TotalAmt - item?.OfferAmt || 0 - : item?.TotalAmt - item?.OfferValue || - 0} - - )} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || + 0} + + )} ); })} @@ -1136,12 +1137,12 @@ const PrintStyle11 = ({ {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && ( -
- Off -
- )} +
+ Off +
+ )} {/*
SUB TOTAL
ROUND OFF
*/} @@ -1162,14 +1163,14 @@ const PrintStyle11 = ({ {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && ( -
- {GlobaldummyData - ? '8' - : Number( +
+ {GlobaldummyData + ? '8' + : Number( TotalOfferAmount + table2Data?.OverallDisc ).toFixed(2)} -
- )} +
+ )} {/*
{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount) ? Number(table2Data?.NetAmount) : 0}
*/} {/*
{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2) ? Number(table2Data?.NetAmount).toFixed(2) : 0}
*/} @@ -1574,34 +1575,34 @@ const PrintStyle11 = ({ {GlobaldummyData ? GlobalCredit && ( -
-
Advance Amount:
-
Opening Balance:
-
- ) +
+
Advance Amount:
+
Opening Balance:
+
+ ) : CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
- {/* OLD CREDIT BAL */} - {PaymentStatusSuccess?.[0]?.PaymentTypeName === - 'Credit' && ( + table2Data?.CustomerDetails?.length > 0 && ( +
+ {/* OLD CREDIT BAL */} + {PaymentStatusSuccess?.[0]?.PaymentTypeName === + 'Credit' && ( <> {table2Data.CustomerDetails[0].OldCreditBal > - 0 ? ( + 0 ? (

Advance Amount: {table2Data.CustomerDetails[0].OldCreditBal} @@ -1619,26 +1620,26 @@ const PrintStyle11 = ({ )} - {/* CURRENT CREDIT BAL */} - {table2Data.CustomerDetails[0].CurrentCreditBal > + {/* CURRENT CREDIT BAL */} + {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( -

- {' '} - Current Advance Amount:{' '} - {table2Data.CustomerDetails[0].CurrentCreditBal} -

- ) : table2Data.CustomerDetails[0].CurrentCreditBal < - 0 ? ( -

- {' '} - Current Balance Amount:{' '} - {Math.abs( - table2Data.CustomerDetails[0].CurrentCreditBal - )} -

- ) : null} -
- )} +

+ {' '} + Current Advance Amount:{' '} + {table2Data.CustomerDetails[0].CurrentCreditBal} +

+ ) : table2Data.CustomerDetails[0].CurrentCreditBal < + 0 ? ( +

+ {' '} + Current Balance Amount:{' '} + {Math.abs( + table2Data.CustomerDetails[0].CurrentCreditBal + )} +

+ ) : null} +
+ )}
{GlobaldummyData ? GlobalQrcodet && ( -
- QRcode -
Scan to Pay
-
- ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2) - ? Number(table2Data?.NetAmount).toFixed(2) - : 0} -
+
+ QRcode +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2) + ? Number(table2Data?.NetAmount).toFixed(2) + : 0}
- ) +
+ ) : !estimatePrintHeader && table2Data?.OrderType === 'E' ? '' : Qrcodet && - paymentTypeUPI && ( + paymentTypeUPI && ( +
+ +
+ Scan to Pay{' '} +
- -
- Scan to Pay{' '} -
-
- ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)}
- )} +
+ )}

@@ -1876,25 +1877,25 @@ const PrintStyle11 = ({ > {GlobaldummyData ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

+ +
+
+ ) + : !estimatePrintHeader && table2Data?.OrderType === 'E' + ? '' + : Notestext && (

- Notes : 10 days Return policy + {Notestext}


- ) - : !estimatePrintHeader && table2Data?.OrderType === 'E' - ? '' - : Notestext && ( -
-

- {Notestext} -

- -
-
- )} + )}
{GlobaldummyData ? GlobaltermsAndConditions && ( +
+

+ Terms & Conditions +

+
    +
  1. + Once goods are sold, they are not + exchangeable or refundable. +
  2. +
  3. + Please check the product before leaving the + counter. +
  4. +
+
+ ) + : !estimatePrintHeader && + table2Data?.OrderType === 'E' + ? '' + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && (

-

  • - Once goods are sold, they are not - exchangeable or refundable. -
  • -
  • - Please check the product before leaving the - counter. -
  • + {TermsAndConditions?.map((item) => ( +
  • + {item?.TermsandConditions} +
  • + ))} + {/*
  • Please check the product before leaving the counter.
  • */}
    - ) - : !estimatePrintHeader && - table2Data?.OrderType === 'E' - ? '' - : TermsnAdCondition == true && - TermsAndConditions?.length > 0 && ( -
    -

    - Terms & Conditions -

    -
      - {TermsAndConditions?.map((item) => ( -
    1. - {item?.TermsandConditions} -
    2. - ))} - {/*
    3. Please check the product before leaving the counter.
    4. */} -
    -
    - )} + )} {GlobaldummyData ? GlobalSignature && ( +
    +

    + Signature +

    + +
    + ) + : !estimatePrintHeader && + table2Data?.OrderType === 'E' + ? '' + : Signature == true && (
    @@ -2007,45 +2041,12 @@ const PrintStyle11 = ({ Signature

    - ) - : !estimatePrintHeader && - table2Data?.OrderType === 'E' - ? '' - : Signature == true && ( -
    -

    - Signature -

    - -
    - )} + )}
    @@ -2105,12 +2106,12 @@ const PrintStyle11 = ({ {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && ( -
    - Off -
    - )} +
    + Off +
    + )} {/*
    SUB TOTAL
    ROUND OFF
    */} @@ -2131,14 +2132,14 @@ const PrintStyle11 = ({ {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && ( -
    - {GlobaldummyData - ? '8' - : Number( +
    + {GlobaldummyData + ? '8' + : Number( TotalOfferAmount + table2Data?.OverallDisc ).toFixed(2)} -
    - )} +
    + )} {/*
    {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount) ? Number(table2Data?.NetAmount) : 0}
    */} {/*
    {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2) ? Number(table2Data?.NetAmount).toFixed(2) : 0}
    */} @@ -2536,34 +2537,34 @@ const PrintStyle11 = ({ )} {GlobaldummyData ? GlobalCredit && ( -
    -
    Advance Amount:
    -
    Opening Balance:
    -
    - ) +
    +
    Advance Amount:
    +
    Opening Balance:
    +
    + ) : CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
    - {/* OLD CREDIT BAL */} - {PaymentStatusSuccess?.[0]?.PaymentTypeName === - 'Credit' && ( + table2Data?.CustomerDetails?.length > 0 && ( +
    + {/* OLD CREDIT BAL */} + {PaymentStatusSuccess?.[0]?.PaymentTypeName === + 'Credit' && ( <> {table2Data.CustomerDetails[0].OldCreditBal > - 0 ? ( + 0 ? (

    Advance Amount: {table2Data.CustomerDetails[0].OldCreditBal} @@ -2581,26 +2582,26 @@ const PrintStyle11 = ({ )} - {/* CURRENT CREDIT BAL */} - {table2Data.CustomerDetails[0].CurrentCreditBal > + {/* CURRENT CREDIT BAL */} + {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( -

    - {' '} - Current Advance Amount:{' '} - {table2Data.CustomerDetails[0].CurrentCreditBal} -

    - ) : table2Data.CustomerDetails[0].CurrentCreditBal < - 0 ? ( -

    - {' '} - Current Balance Amount:{' '} - {Math.abs( - table2Data.CustomerDetails[0].CurrentCreditBal - )} -

    - ) : null} -
    - )} +

    + {' '} + Current Advance Amount:{' '} + {table2Data.CustomerDetails[0].CurrentCreditBal} +

    + ) : table2Data.CustomerDetails[0].CurrentCreditBal < + 0 ? ( +

    + {' '} + Current Balance Amount:{' '} + {Math.abs( + table2Data.CustomerDetails[0].CurrentCreditBal + )} +

    + ) : null} +
    + )}
    - QRcode -
    Scan to Pay
    -
    - ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2) - ? Number(table2Data?.NetAmount).toFixed(2) - : 0} -
    +
    + QRcode +
    Scan to Pay
    +
    + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2) + ? Number(table2Data?.NetAmount).toFixed(2) + : 0}
    - ) +
    + ) : !estimatePrintHeader && table2Data?.OrderType === 'E' ? '' : Qrcodet && - paymentTypeUPI && ( -
    - -
    - Scan to Pay{' '} -
    -
    - ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
    + paymentTypeUPI && ( +
    + +
    + Scan to Pay{' '}
    - )} +
    + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
    +
    + )}

    {isEditedBill && lastTransaction && ( @@ -2828,25 +2829,25 @@ const PrintStyle11 = ({ > {GlobaldummyData ? GlobalIsnotes && ( +
    +

    + Notes : 10 days Return policy +

    + +
    +
    + ) + : !estimatePrintHeader && table2Data?.OrderType === 'E' + ? '' + : Notestext && (

    - Notes : 10 days Return policy + {Notestext}


    - ) - : !estimatePrintHeader && table2Data?.OrderType === 'E' - ? '' - : Notestext && ( -
    -

    - {Notestext} -

    - -
    -
    - )} + )}
    {GlobaldummyData ? GlobaltermsAndConditions && ( +
    +

    + Terms & Conditions +

    +
      +
    1. + Once goods are sold, they are not exchangeable + or refundable. +
    2. +
    3. + Please check the product before leaving the + counter. +
    4. +
    +
    + ) + : !estimatePrintHeader && table2Data?.OrderType === 'E' + ? '' + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && (

    -

  • - Once goods are sold, they are not exchangeable - or refundable. -
  • -
  • - Please check the product before leaving the - counter. -
  • + {TermsAndConditions?.map((item) => ( +
  • + {item?.TermsandConditions} +
  • + ))} + {/*
  • Please check the product before leaving the counter.
  • */}
    - ) - : !estimatePrintHeader && table2Data?.OrderType === 'E' - ? '' - : TermsnAdCondition == true && - TermsAndConditions?.length > 0 && ( -
    -

    - Terms & Conditions -

    -
      - {TermsAndConditions?.map((item) => ( -
    1. - {item?.TermsandConditions} -
    2. - ))} - {/*
    3. Please check the product before leaving the counter.
    4. */} -
    -
    - )} + )} {GlobaldummyData ? GlobalSignature && ( +
    +

    + Signature +

    + +
    + ) + : !estimatePrintHeader && table2Data?.OrderType === 'E' + ? '' + : Signature == true && (
    @@ -2958,44 +2991,12 @@ const PrintStyle11 = ({ Signature

    - ) - : !estimatePrintHeader && table2Data?.OrderType === 'E' - ? '' - : Signature == true && ( -
    -

    - Signature -

    - -
    - )} + )}
    @@ -3038,8 +3039,8 @@ const PrintStyle11 = ({ /> ) : null} {base64Image && - base64Image && - (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( + base64Image && + (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} @@ -3069,18 +3070,18 @@ const PrintStyle11 = ({ {GlobaldummyData ? 'BranchAddress, Town- 635XXX City - State' : (table2Data?.AddressDetails?.[0]?.Address1 || '') + - (table2Data?.AddressDetails?.[0]?.City - ? (table2Data?.AddressDetails?.[0]?.Address1 && - table2Data?.AddressDetails?.[0]?.City - ? '-' - : '') + table2Data?.AddressDetails?.[0]?.City - : '') + - (table2Data?.AddressDetails?.[0]?.Zip - ? (table2Data?.AddressDetails?.[0]?.City && - table2Data?.AddressDetails?.[0]?.Zip - ? '-' - : '') + table2Data?.AddressDetails?.[0]?.Zip - : '')} + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')}
    {' '} @@ -3122,10 +3123,10 @@ const PrintStyle11 = ({ {GlobaldummyData ? '553' : table2Data?.OrderId && - extractLastNumberOrderId( - table2Data?.OrderId, - table2Data?.FYStatus - )} + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}
    )} @@ -3170,83 +3171,83 @@ const PrintStyle11 = ({ : Item && Item} {GlobaldummyData ? GlobalQuantity && ( - - Qty - - ) + + Qty + + ) : Quantity && ( - - {' '} - {WeightasKg ? 'Qty/Kg' : 'Qty'} - - )} + + {' '} + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - HSN - - ) + + HSN + + ) : HsnCode && ( - - HSN - - )} + + HSN + + )} {GlobaldummyData ? GlobalMRP && ( - - MRP - - ) + + MRP + + ) : MRP && ( - - MRP - - )} + + MRP + + )} {GlobaldummyData ? GlobalDiscount && ( - - Dis{' '} - - ) + + Dis{' '} + + ) : Discount && ( - - Dis{' '} - - )} + + Dis{' '} + + )} {GlobaldummyData ? GlobalTax && ( - - Tax %{' '} - - ) + + Tax %{' '} + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - Tax %{' '} - - )} + table2Data?.OrderType !== 'E' && ( + + Tax %{' '} + + )} {GlobaldummyData ? GlobalRate && ( - - Rate - - ) + + Rate + + ) : Rate && ( - - Rate - - )} + + Rate + + )} {GlobaldummyData ? GlobalAmount && ( - - Amt - - ) + + Amt + + ) : Amount && ( - - Amt - - )} + + Amt + + )} @@ -3260,195 +3261,195 @@ const PrintStyle11 = ({ {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item && ( - -
    {item?.ProdName}
    - {PackageDetails?.filter( - (pkg) => pkg.ProdId === item.ProdId - ).length > 0 ? ( -
    - {PackageDetails?.filter( - (pkg) => pkg.ProdId === item.ProdId - )?.map((item, index) => ( - - {item.ParcelCount} PCS{' '} - {item.ParcelQty} PACK ( - {item.ParcelType}) - - ))} - {item?.BrandName !== null - ? item?.BrandName - : ''} -   - {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls?.filter( - (items) => - !( - items.SerialNumber == '' || - items.SerialNumber == null - ) - )?.map((a) => { - return ( -
    {a.SerialNumber}
    - ); - }) - : ''}{' '} - {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (item1) => - item1.IMEI1 !== '' || - item1.IMEI2 !== '' - )?.map((item2) => { - const imei1 = item2.IMEI1 || ''; - const imei2 = item2.IMEI2 || ''; - return ( -
    - {[imei1, imei2] - .filter(Boolean) - .join(',')} -
    - ); - }) - : ''} -
    - ) : ( -
    - ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) - {item?.BrandName !== null - ? item?.BrandName - : ''} -   - {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls?.filter( - (items) => - !( - items.SerialNumber == '' || - items.SerialNumber == null - ) - )?.map((a) => { - return ( -
    {a.SerialNumber}
    - ); - }) - : ''}{' '} - {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (item1) => - item1.IMEI1 !== '' || - item1.IMEI2 !== '' - )?.map((item2) => { - const imei1 = item2.IMEI1 || ''; - const imei2 = item2.IMEI2 || ''; - return ( -
    - {[imei1, imei2] - .filter(Boolean) - .join(',')} -
    - ); - }) - : ''} -
    - )} - - )} + +
    {item?.ProdName}
    + {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + ).length > 0 ? ( +
    + {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + )?.map((item, index) => ( + + {item.ParcelCount} PCS{' '} + {item.ParcelQty} PACK ( + {item.ParcelType}) + + ))} + {item?.BrandName !== null + ? item?.BrandName + : ''} +   + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls?.filter( + (items) => + !( + items.SerialNumber == '' || + items.SerialNumber == null + ) + )?.map((a) => { + return ( +
    {a.SerialNumber}
    + ); + }) + : ''}{' '} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
    + {[imei1, imei2] + .filter(Boolean) + .join(',')} +
    + ); + }) + : ''} +
    + ) : ( +
    + ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) + {item?.BrandName !== null + ? item?.BrandName + : ''} +   + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls?.filter( + (items) => + !( + items.SerialNumber == '' || + items.SerialNumber == null + ) + )?.map((a) => { + return ( +
    {a.SerialNumber}
    + ); + }) + : ''}{' '} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
    + {[imei1, imei2] + .filter(Boolean) + .join(',')} +
    + ); + }) + : ''} +
    + )} + + )} {GlobaldummyData ? GlobalQuantity && ( - - {item?.SalesQty} - - ) + + {item?.SalesQty} + + ) : Quantity && ( - - {item?.SalesQty} - - )} + + {item?.SalesQty} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - - ) + + {item?.HSN} + + ) : HsnCode && ( - - {item?.HSN} - - )} + + {item?.HSN} + + )} {GlobaldummyData ? GlobalMRP && ( - - {item?.MRP} - - ) + + {item?.MRP} + + ) : MRP && ( - - {item?.SinglePc === 'Y' - ? item?.Rate - : item?.MRP} - - )} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + )} {GlobaldummyData ? GlobalDiscount && ( - - {item.discount} - - ) + + {item.discount} + + ) : Discount && ( - - {item?.Type != 'C' - ? item?.OfferAmt || 0 - : item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} {GlobaldummyData ? GlobalTax && ( - - {item.ProdTaxPercentage} - - ) + + {item.ProdTaxPercentage} + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - {item?.ProdTaxPercentage || 0} - - )} + table2Data?.OrderType !== 'E' && ( + + {item?.ProdTaxPercentage || 0} + + )} {GlobaldummyData ? GlobalRate && ( - - {item?.Rate} - - ) + + {item?.Rate} + + ) : Rate && ( - - {item?.Rate} - - )} + + {item?.Rate} + + )} {GlobaldummyData ? GlobalAmount && ( - - {item?.TotalAmt} - - ) + + {item?.TotalAmt} + + ) : Amount && ( - - {item?.Type != 'C' - ? item?.TotalAmt - item?.OfferAmt || 0 - : item?.TotalAmt - item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} + + )} ); } @@ -3483,83 +3484,83 @@ const PrintStyle11 = ({ : Item && Item} {GlobaldummyData ? GlobalQuantity && ( - - Qty - - ) + + Qty + + ) : Quantity && ( - - {' '} - {WeightasKg ? 'Qty/Kg' : 'Qty'} - - )} + + {' '} + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - HSN - - ) + + HSN + + ) : HsnCode && ( - - HSN - - )} + + HSN + + )} {GlobaldummyData ? GlobalMRP && ( - - MRP - - ) + + MRP + + ) : MRP && ( - - MRP - - )} + + MRP + + )} {GlobaldummyData ? GlobalDiscount && ( - - Dis{' '} - - ) + + Dis{' '} + + ) : Discount && ( - - Dis{' '} - - )} + + Dis{' '} + + )} {GlobaldummyData ? GlobalTax && ( - - Tax %{' '} - - ) + + Tax %{' '} + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - Tax %{' '} - - )} + table2Data?.OrderType !== 'E' && ( + + Tax %{' '} + + )} {GlobaldummyData ? GlobalRate && ( - - Rate - - ) + + Rate + + ) : Rate && ( - - Rate - - )} + + Rate + + )} {GlobaldummyData ? GlobalAmount && ( - - Amt - - ) + + Amt + + ) : Amount && ( - - Amt - - )} + + Amt + + )} @@ -3573,108 +3574,108 @@ const PrintStyle11 = ({ {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item && ( - -
    {item?.ProdName}
    -
    - ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) -
    - - )} + +
    {item?.ProdName}
    +
    + ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) +
    + + )} {GlobaldummyData ? GlobalQuantity && ( - - {item?.SalesQty} - - ) + + {item?.SalesQty} + + ) : Quantity && ( - - {item?.SalesQty} - - )} + + {item?.SalesQty} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - - ) + + {item?.HSN} + + ) : HsnCode && ( - - {item?.HSN} - - )} + + {item?.HSN} + + )} {GlobaldummyData ? GlobalMRP && ( - - {item?.MRP} - - ) + + {item?.MRP} + + ) : MRP && ( - - {item?.SinglePc === 'Y' - ? item?.Rate - : item?.MRP} - - )} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + )} {GlobaldummyData ? GlobalDiscount && ( - - {item.discount} - - ) + + {item.discount} + + ) : Discount && ( - - {item?.Type != 'C' - ? item?.OfferAmt || 0 - : item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} {GlobaldummyData ? GlobalTax && ( - - {item.ProdTaxPercentage} - - ) + + {item.ProdTaxPercentage} + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - {item?.ProdTaxPercentage || 0} - - )} + table2Data?.OrderType !== 'E' && ( + + {item?.ProdTaxPercentage || 0} + + )} {GlobaldummyData ? GlobalRate && ( - - {item?.Rate} - - ) + + {item?.Rate} + + ) : Rate && ( - - {item?.Rate} - - )} + + {item?.Rate} + + )} {GlobaldummyData ? GlobalAmount && ( - - {item?.TotalAmt} - - ) + + {item?.TotalAmt} + + ) : Amount && ( - - {item?.Type != 'C' - ? item?.TotalAmt - item?.OfferAmt || 0 - : item?.TotalAmt - item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} + + )} ); } @@ -3721,8 +3722,8 @@ const PrintStyle11 = ({ {GlobaldummyData ? '8' : Number( - TotalOfferAmount + table2Data?.OverallDisc - ).toFixed(2)} + TotalOfferAmount + table2Data?.OverallDisc + ).toFixed(2)} )} {/*
    {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount) ? Number(table2Data?.NetAmount) : 0}
    */} @@ -4201,48 +4202,48 @@ const PrintStyle11 = ({ {GlobaldummyData ? GlobalQrcodet && ( -
    - QRcode -
    Scan to Pay
    -
    - ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2) - ? Number(table2Data?.NetAmount).toFixed(2) - : 0} -
    +
    + QRcode +
    Scan to Pay
    +
    + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2) + ? Number(table2Data?.NetAmount).toFixed(2) + : 0}
    - ) +
    + ) : !estimatePrintHeader && table2Data?.OrderType === 'E' ? '' : Qrcodet && - paymentTypeUPI && ( -
    - -
    Scan to Pay
    -
    - ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
    + paymentTypeUPI && ( +
    + +
    Scan to Pay
    +
    + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)}
    - )} +
    + )}

    @@ -4334,28 +4335,28 @@ const PrintStyle11 = ({ > {GlobaldummyData ? GlobalIsnotes && ( -
    -

    - Notes : 10 days Return policy -

    +
    +

    + Notes : 10 days Return policy +

    -
    -
    - ) +
    +
    + ) : !estimatePrintHeader && table2Data?.OrderType === 'E' ? '' : Notestext && ( -
    -

    {Notestext}

    +
    +

    {Notestext}

    -
    -
    - )} +
    +
    + )}
    {GlobaldummyData ? GlobaltermsAndConditions && ( +
    +

    + Terms & Conditions +

    +
      +
    1. + Once goods are sold, they are not exchangeable or + refundable. +
    2. +
    3. + Please check the product before leaving the counter. +
    4. +
    +
    + ) + : !estimatePrintHeader && table2Data?.OrderType === 'E' + ? '' + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && (

    -

  • - Once goods are sold, they are not exchangeable or - refundable. -
  • -
  • - Please check the product before leaving the counter. -
  • + {TermsAndConditions?.map((item) => ( +
  • + {item?.TermsandConditions} +
  • + ))} + {/*
  • Please check the product before leaving the counter.
  • */}
    - ) - : !estimatePrintHeader && table2Data?.OrderType === 'E' - ? '' - : TermsnAdCondition == true && - TermsAndConditions?.length > 0 && ( -
    -

    - Terms & Conditions -

    -
      - {TermsAndConditions?.map((item) => ( -
    1. - {item?.TermsandConditions} -
    2. - ))} - {/*
    3. Please check the product before leaving the counter.
    4. */} -
    -
    - )} + )} {GlobaldummyData ? GlobalSignature && ( +
    +

    + Signature +

    + +
    + ) + : !estimatePrintHeader && table2Data?.OrderType === 'E' + ? '' + : Signature == true && (
    @@ -4466,44 +4499,12 @@ const PrintStyle11 = ({ Signature

    - ) - : !estimatePrintHeader && table2Data?.OrderType === 'E' - ? '' - : Signature == true && ( -
    -

    - Signature -

    - -
    - )} + )}
    diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle12.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle12.jsx index 5197d9b..fbfeaa2 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle12.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle12.jsx @@ -103,6 +103,7 @@ const Printstyle12 = ({ const GlobalLogo = useSelector(GlobalprintLogo); const GlobalCredit = useSelector(GlobalprintCredit); const SettingData = useSelector(PreferenceData); + const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor); const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find( (setting) => @@ -495,8 +496,8 @@ const Printstyle12 = ({ flexDirection: 'column', justifyContent: chunkIndex === paginatedChunks.length - 1 && - !shouldFooterBeOnNewPage && - FormatTheme + !shouldFooterBeOnNewPage && + FormatTheme ? 'space-between' : '', height: isMobile @@ -550,18 +551,18 @@ const Printstyle12 = ({ {GlobaldummyData ? 'BranchAddress, Town- 635XXX City - State' : (table2Data?.AddressDetails?.[0]?.Address1 || '') + - (table2Data?.AddressDetails?.[0]?.City - ? (table2Data?.AddressDetails?.[0]?.Address1 && - table2Data?.AddressDetails?.[0]?.City - ? '-' - : '') + table2Data?.AddressDetails?.[0]?.City - : '') + - (table2Data?.AddressDetails?.[0]?.Zip - ? (table2Data?.AddressDetails?.[0]?.City && - table2Data?.AddressDetails?.[0]?.Zip - ? '-' - : '') + table2Data?.AddressDetails?.[0]?.Zip - : '')} + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')}
    @@ -689,10 +690,10 @@ const Printstyle12 = ({ {GlobaldummyData ? '553' : table2Data?.OrderId && - extractLastNumberOrderId( - table2Data?.OrderId, - table2Data?.FYStatus - )} + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}
    Des} {GlobaldummyData ? GlobalQuantity && ( - Qty - ) + Qty + ) : Quantity && ( - - {' '} - {WeightasKg ? 'Qty/Kg' : 'Qty'} - - )} + + {' '} + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + )} {GlobaldummyData ? GlobalMRP && ( - MRP - ) + MRP + ) : MRP && ( - MRP - )} + MRP + )} {GlobaldummyData ? GlobalRate && ( - Rate - ) + Rate + ) : Rate && ( - Rate - )} + Rate + )} {GlobaldummyData ? GlobalHsnCode && ( - HSN - ) + HSN + ) : HsnCode && ( - HSN - )} + HSN + )} {GlobaldummyData ? GlobalDiscount && ( - (%) - ) + (%) + ) : Discount && ( - (%) - )} + (%) + )} {GlobaldummyData ? GlobalTax && ( - - Tax (%) - - ) + + Tax (%) + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - Tax (%) - - )} + table2Data?.OrderType !== 'E' && ( + + Tax (%) + + )} {GlobaldummyData ? GlobalAmount && ( - Amt - ) + Amt + ) : Amount && ( - Amt - )} + Amt + )} @@ -801,214 +802,214 @@ const Printstyle12 = ({ {GlobaldummyData ? GlobalSlNo && {index + 1} : SLNO && ( - - {chunkIndex * chunkSize + index + 1} - - )} + + {chunkIndex * chunkSize + index + 1} + + )} {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item && ( - -
    {item?.ProdName}
    - {PackageDetails?.filter( - (pkg) => pkg.ProdId === item.ProdId - ).length > 0 ? ( -
    - {PackageDetails?.filter( - (pkg) => - pkg.ProdId === item.ProdId - )?.map((item, index) => ( - - {item.ParcelCount} PCS{' '} - {item.ParcelQty} PACK ( - {item.ParcelType}) - - ))} - {item?.BrandName !== null - ? item?.BrandName - : ''} -   - {item?.ProductIdentifierDtls - ?.length > 0 - ? item?.ProductIdentifierDtls?.filter( - (items) => - !( - items.SerialNumber == - '' || - items.SerialNumber == null - ) - )?.map((a) => { - return ( -
    {a.SerialNumber}
    - ); - }) - : ''}{' '} - {item?.ProductIdentifierDtls - ?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (item1) => - item1.IMEI1 !== '' || - item1.IMEI2 !== '' - )?.map((item2) => { - const imei1 = - item2.IMEI1 || ''; - const imei2 = - item2.IMEI2 || ''; - return ( -
    - {[imei1, imei2] - .filter(Boolean) - .join(',')} -
    - ); - }) - : ''} -
    - ) : ( -
    - ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) - {item?.BrandName !== null - ? item?.BrandName - : ''} -   - {item?.ProductIdentifierDtls - ?.length > 0 - ? item?.ProductIdentifierDtls?.filter( - (items) => - !( - items.SerialNumber == - '' || - items.SerialNumber == null - ) - )?.map((a) => { - return ( -
    {a.SerialNumber}
    - ); - }) - : ''}{' '} - {item?.ProductIdentifierDtls - ?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (item1) => - item1.IMEI1 !== '' || - item1.IMEI2 !== '' - )?.map((item2) => { - const imei1 = - item2.IMEI1 || ''; - const imei2 = - item2.IMEI2 || ''; - return ( -
    - {[imei1, imei2] - .filter(Boolean) - .join(',')} -
    - ); - }) - : ''} -
    - )} - - )} + +
    {item?.ProdName}
    + {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + ).length > 0 ? ( +
    + {PackageDetails?.filter( + (pkg) => + pkg.ProdId === item.ProdId + )?.map((item, index) => ( + + {item.ParcelCount} PCS{' '} + {item.ParcelQty} PACK ( + {item.ParcelType}) + + ))} + {item?.BrandName !== null + ? item?.BrandName + : ''} +   + {item?.ProductIdentifierDtls + ?.length > 0 + ? item?.ProductIdentifierDtls?.filter( + (items) => + !( + items.SerialNumber == + '' || + items.SerialNumber == null + ) + )?.map((a) => { + return ( +
    {a.SerialNumber}
    + ); + }) + : ''}{' '} + {item?.ProductIdentifierDtls + ?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2) => { + const imei1 = + item2.IMEI1 || ''; + const imei2 = + item2.IMEI2 || ''; + return ( +
    + {[imei1, imei2] + .filter(Boolean) + .join(',')} +
    + ); + }) + : ''} +
    + ) : ( +
    + ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) + {item?.BrandName !== null + ? item?.BrandName + : ''} +   + {item?.ProductIdentifierDtls + ?.length > 0 + ? item?.ProductIdentifierDtls?.filter( + (items) => + !( + items.SerialNumber == + '' || + items.SerialNumber == null + ) + )?.map((a) => { + return ( +
    {a.SerialNumber}
    + ); + }) + : ''}{' '} + {item?.ProductIdentifierDtls + ?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2) => { + const imei1 = + item2.IMEI1 || ''; + const imei2 = + item2.IMEI2 || ''; + return ( +
    + {[imei1, imei2] + .filter(Boolean) + .join(',')} +
    + ); + }) + : ''} +
    + )} + + )} {GlobaldummyData ? GlobalQuantity && ( - - {item?.SalesQty} - - ) + + {item?.SalesQty} + + ) : Quantity && ( - - {item?.SalesQty} - - )} + + {item?.SalesQty} + + )} {GlobaldummyData ? GlobalMRP && ( - - {item?.MRP} - - ) + + {item?.MRP} + + ) : MRP && ( - - {item?.SinglePc === 'Y' - ? item?.Rate - : item?.MRP} - - )} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + )} {GlobaldummyData ? GlobalRate && ( - - {item?.Rate} - - ) + + {item?.Rate} + + ) : Rate && ( - - {item?.Rate} - - )} + + {item?.Rate} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - - ) + + {item?.HSN} + + ) : HsnCode && ( - - {item?.HSN} - - )} + + {item?.HSN} + + )} {GlobaldummyData ? GlobalDiscount && ( - - {item?.discount} - - ) + + {item?.discount} + + ) : Discount && ( - - {item?.Type != 'C' - ? item?.OfferAmt || 0 - : item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} {GlobaldummyData ? GlobalTax && ( - - {item?.ProdTaxPercentage} - - ) + + {item?.ProdTaxPercentage} + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - {item?.ProdTaxPercentage || 0} - - )} + table2Data?.OrderType !== 'E' && ( + + {item?.ProdTaxPercentage || 0} + + )} {GlobaldummyData ? GlobalAmount && ( - - {item?.TotalAmt} - - ) + + {item?.TotalAmt} + + ) : Amount && ( - - {item?.Type != 'C' - ? item?.TotalAmt - item?.OfferAmt || 0 - : item?.TotalAmt - item?.OfferValue || - 0} - - )} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || + 0} + + )} ); })} @@ -1043,61 +1044,61 @@ const Printstyle12 = ({ : Item && Des} {GlobaldummyData ? GlobalQuantity && ( - Qty - ) + Qty + ) : Quantity && ( - - {' '} - {WeightasKg ? 'Qty/Kg' : 'Qty'} - - )} + + {' '} + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + )} {GlobaldummyData ? GlobalMRP && ( - MRP - ) + MRP + ) : MRP && ( - MRP - )} + MRP + )} {GlobaldummyData ? GlobalRate && ( - Rate - ) + Rate + ) : Rate && ( - Rate - )} + Rate + )} {GlobaldummyData ? GlobalHsnCode && ( - HSN - ) + HSN + ) : HsnCode && ( - HSN - )} + HSN + )} {GlobaldummyData ? GlobalDiscount && ( - (%) - ) + (%) + ) : Discount && ( - (%) - )} + (%) + )} {GlobaldummyData ? GlobalTax && ( - - Tax (%) - - ) + + Tax (%) + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - Tax (%) - - )} + table2Data?.OrderType !== 'E' && ( + + Tax (%) + + )} {GlobaldummyData ? GlobalAmount && ( - Amt - ) + Amt + ) : Amount && ( - Amt - )} + Amt + )} @@ -1107,116 +1108,116 @@ const Printstyle12 = ({ {GlobaldummyData ? GlobalSlNo && {index + 1} : SLNO && ( - - {chunkIndex * chunkSize + index + 1} - - )} + + {chunkIndex * chunkSize + index + 1} + + )} {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item && ( - -
    {item?.ProdName}
    -
    - ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) -
    - - )} + +
    {item?.ProdName}
    +
    + ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) +
    + + )} {GlobaldummyData ? GlobalQuantity && ( - - {item?.SalesQty} - - ) + + {item?.SalesQty} + + ) : Quantity && ( - - {item?.SalesQty} - - )} + + {item?.SalesQty} + + )} {GlobaldummyData ? GlobalMRP && ( - - {item?.MRP} - - ) + + {item?.MRP} + + ) : MRP && ( - - {item?.SinglePc === 'Y' - ? item?.Rate - : item?.MRP} - - )} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + )} {GlobaldummyData ? GlobalRate && ( - - {item?.Rate} - - ) + + {item?.Rate} + + ) : Rate && ( - - {item?.Rate} - - )} + + {item?.Rate} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - - ) + + {item?.HSN} + + ) : HsnCode && ( - - {item?.HSN} - - )} + + {item?.HSN} + + )} {GlobaldummyData ? GlobalDiscount && ( - - {item?.discount} - - ) + + {item?.discount} + + ) : Discount && ( - - {item?.Type != 'C' - ? item?.OfferAmt || 0 - : item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} {GlobaldummyData ? GlobalTax && ( - - {item?.ProdTaxPercentage} - - ) + + {item?.ProdTaxPercentage} + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - {item?.ProdTaxPercentage || 0} - - )} + table2Data?.OrderType !== 'E' && ( + + {item?.ProdTaxPercentage || 0} + + )} {GlobaldummyData ? GlobalAmount && ( - - {item?.TotalAmt} - - ) + + {item?.TotalAmt} + + ) : Amount && ( - - {item?.Type != 'C' - ? item?.TotalAmt - item?.OfferAmt || 0 - : item?.TotalAmt - item?.OfferValue || - 0} - - )} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || + 0} + + )} ); })} @@ -1285,30 +1286,30 @@ const Printstyle12 = ({
    {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && ( -
    -
    Off
    -
    :
    - {GlobaldummyData - ? '9' - : Number( +
    Off
    +
    :
    +
    + {GlobaldummyData + ? '9' + : Number( TotalOfferAmount + table2Data?.OverallDisc ).toFixed(2)} +
    -
    - )} + )} {/*
    Extra Charges @@ -1439,6 +1440,997 @@ const Printstyle12 = ({ OrderDetailIGST?.[0]?.TaxAmt > 0) || (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( + <> +
    +

    + --------- GST Breakup Details ----------- +

    + {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + + ))} +
    + Taxable Amount + + CGST + + SGST + + Total Amount +
    + {item?.TaxPercentage || 0}% + + {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
    + )} + + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
    + + + + + + + + {OrderDetailIGST?.map((item) => ( + + + + + + + ))} +
    + Taxable Amount + + IGST + + Total Amount +
    + {item?.TaxPercentage || 0}% + + {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed( + 2 + )} +
    + + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
    + + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
    + Taxable Amount + + VAT + + Total Amount +
    + {item?.TaxPercentage || 0}% + + {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed( + 2 + )} +
    + + )} +
    + + )} +
    + )} +
    + +
    +
    + {PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + : 'Split'}{' '} +   Payment +
    +
    :
    +
    + {GlobaldummyData + ? '1,066.00' + : Number(table2Data?.NetAmount).toFixed(2) + ? Number(table2Data?.NetAmount).toFixed(2) + : 0} +
    +
    + {/*
    +
    + Recived Amt +
    +
    :
    +
    + {GlobaldummyData ? '1,066.00' : Number(table2Data?.NetAmount).toFixed(2) ? Number(table2Data?.NetAmount).toFixed(2) : 0} +
    +
    +
    +
    + Balance Amt +
    +
    :
    +
    + 0.00 +
    +
    */} +
    +
    + + {isEditedBill && lastTransaction && ( +
    +
    +
    + + Bill Gross Amount + + + {(lastTransaction?.BeforeAdjustment || 0).toFixed( + 2 + )} + +
    +
    + {'Adjustment Amount'} + + {lastTransaction?.AdjustmentType === 'REFUND' + ? '-' + : '+'} + {(lastTransaction?.Amount || 0).toFixed(2)} + +
    +
    + + Net Bill Amount + + + {(lastTransaction?.AfterAdjustment || 0).toFixed( + 2 + )} + +
    +
    +
    + )} + + {GlobaldummyData + ? GlobalCredit && ( +
    +
    Advance Amount:
    +
    Opening Balance:
    +
    + ) + : CreditDetails && + table2Data?.CustomerDetails?.length > 0 && ( +
    + {/* OLD CREDIT BAL */} + {PaymentStatusSuccess?.[0]?.PaymentTypeName === + 'Credit' && ( + <> + {table2Data.CustomerDetails[0].OldCreditBal > + 0 ? ( +

    + Advance Amount: + {table2Data.CustomerDetails[0].OldCreditBal} +

    + ) : table2Data.CustomerDetails[0].OldCreditBal < + 0 ? ( +

    + {' '} + Opening Balance:{' '} + {Math.abs( + table2Data.CustomerDetails[0].OldCreditBal + )} +

    + ) : null} + + )} + + {/* CURRENT CREDIT BAL */} + {table2Data.CustomerDetails[0].CurrentCreditBal > + 0 ? ( +

    + {' '} + Current Advance Amount:{' '} + {table2Data.CustomerDetails[0].CurrentCreditBal} +

    + ) : table2Data.CustomerDetails[0].CurrentCreditBal < + 0 ? ( +

    + {' '} + Current Balance Amount:{' '} + {Math.abs( + table2Data.CustomerDetails[0].CurrentCreditBal + )} +

    + ) : null} +
    + )} +
    + +
    +
    +
    + Your Order No:{' '} + {GlobaldummyData + ? '53' + : table2Data?.SalesId && + extractLastNumber(table2Data?.SalesId)} +
    +
    + + {GlobaldummyData + ? GlobalQrcodet && ( +
    + image +
    + {' '} + Scan to Pay:{' '} +
    +
    + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2) + ? Number(table2Data?.NetAmount).toFixed(2) + : 0} +
    +
    + ) + : !estimatePrintHeader && table2Data?.OrderType === 'E' + ? '' + : Qrcodet && + paymentTypeUPI && ( +
    + +
    + Scan to Pay{' '} +
    +
    + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
    +
    + )} +
    + {sportsAppPreference && MembershipApplied && ( +
    {`*** Membership ${table2Data?.NetAmount === 0 ? 'Free Hours' : 'Discount'} Utilized - ${MembershipApplied?.Detail?.[0]?.MembershipName} ***`}
    + )} + +
    + {GlobaldummyData + ? GlobalIsnotes && ( +
    +

    + Notes : 10 days Return policy +

    + +
    +
    + ) + : !estimatePrintHeader && table2Data?.OrderType === 'E' + ? '' + : Notestext && ( +
    +

    + {Notestext} +

    + +
    +
    + )} + +
    + {GlobaldummyData + ? GlobaltermsAndConditions && ( +
    +

    + Terms & Conditions +

    +
      +
    1. + Once goods are sold, they are not + exchangeable or refundable. +
    2. +
    3. + Please check the product before leaving the + counter. +
    4. +
    +
    + ) + : !estimatePrintHeader && + table2Data?.OrderType === 'E' + ? '' + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
    +

    + Terms & Conditions +

    +
      + {TermsAndConditions?.map((item) => ( +
    1. + {item?.TermsandConditions} +
    2. + ))} + {/*
    3. Please check the product before leaving the counter.
    4. */} +
    +
    + )} + + {GlobaldummyData + ? GlobalSignature && ( +
    +

    + Signature +

    + +
    + ) + : !estimatePrintHeader && + table2Data?.OrderType === 'E' + ? '' + : Signature == true && ( +
    +

    + Signature +

    + +
    + )} +
    +
    + + {PrintGreeting?.SettingValue === 'Y' && ( +
    + Thank You Visit Again +
    + )} + + )} + + ))} + + {shouldFooterBeOnNewPage && FormatTheme && ( +
    +
    + <> +
    +
    +
    +
    +
    Items
    +
    :
    +
    + {GlobaldummyData ? '8' : totalQuantityFilter?.length} +
    +
    +
    +
    Qty
    +
    :
    +
    + {GlobaldummyData ? '9' : totalQuantity} +
    +
    + {(table2Data?.OverallDisc > 0 || + TotalOfferAmount > 0) && ( +
    +
    Off
    +
    :
    +
    + {GlobaldummyData + ? '9' + : Number( + TotalOfferAmount + table2Data?.OverallDisc + ).toFixed(2)} +
    +
    + )} + {/*
    +
    + Extra Charges +
    +
    :
    +
    + 0 +
    +
    */} + +
    + + {DineInData?.length > 0 && TakeawayData?.length > 0 && ( + <> + {takeAwayPreference && ( +
    +
    + TakeAway +
    +
    :
    +
    + {Number(TakeawayTotal).toFixed(2)} +
    +
    + )} + {dinePreference && ( +
    +
    + Dine In +
    +
    :
    +
    + {Number(DineInTotal).toFixed(2)} +
    +
    + )} + + )} +
    +
    + Amount +
    +
    :
    +
    + {GlobaldummyData + ? '1,066.00' + : Number(table2Data?.NetAmount).toFixed(2) + ? Number(table2Data?.NetAmount).toFixed(2) + : 0} +
    +
    + {PaymentStatusSuccess?.length > 1 && !isEditedBill && ( + <> + {/*

    Split Payment:

    */} + {Object.keys(aggregatedPayments).map( + (paymentType) => ( +
    + {paymentType}:{' '} + {aggregatedPayments[paymentType].toFixed(2)} +
    + ) + )} + + )} + {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
    + {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( <>

    - {Number(item.TotalAmt).toFixed( - 2 - )} + {Number(item.TotalAmt).toFixed(2)} ))} @@ -1706,9 +2696,7 @@ const Printstyle12 = ({ textAlign: 'center', }} > - {Number(item.TotalAmt).toFixed( - 2 - )} + {Number(item.TotalAmt).toFixed(2)} ))} @@ -1718,993 +2706,6 @@ const Printstyle12 = ({

    )} -
    - )} -
    - -
    -
    - {PaymentStatusSuccess?.length === 1 - ? PaymentStatusSuccess?.[0]?.PaymentTypeName - : 'Split'}{' '} -   Payment -
    -
    :
    -
    - {GlobaldummyData - ? '1,066.00' - : Number(table2Data?.NetAmount).toFixed(2) - ? Number(table2Data?.NetAmount).toFixed(2) - : 0} -
    -
    - {/*
    -
    - Recived Amt -
    -
    :
    -
    - {GlobaldummyData ? '1,066.00' : Number(table2Data?.NetAmount).toFixed(2) ? Number(table2Data?.NetAmount).toFixed(2) : 0} -
    -
    -
    -
    - Balance Amt -
    -
    :
    -
    - 0.00 -
    -
    */} -
    -
    - - {isEditedBill && lastTransaction && ( -
    -
    -
    - - Bill Gross Amount - - - {(lastTransaction?.BeforeAdjustment || 0).toFixed( - 2 - )} - -
    -
    - {'Adjustment Amount'} - - {lastTransaction?.AdjustmentType === 'REFUND' - ? '-' - : '+'} - {(lastTransaction?.Amount || 0).toFixed(2)} - -
    -
    - - Net Bill Amount - - - {(lastTransaction?.AfterAdjustment || 0).toFixed( - 2 - )} - -
    -
    -
    - )} - - {GlobaldummyData - ? GlobalCredit && ( -
    -
    Advance Amount:
    -
    Opening Balance:
    -
    - ) - : CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
    - {/* OLD CREDIT BAL */} - {PaymentStatusSuccess?.[0]?.PaymentTypeName === - 'Credit' && ( - <> - {table2Data.CustomerDetails[0].OldCreditBal > - 0 ? ( -

    - Advance Amount: - {table2Data.CustomerDetails[0].OldCreditBal} -

    - ) : table2Data.CustomerDetails[0].OldCreditBal < - 0 ? ( -

    - {' '} - Opening Balance:{' '} - {Math.abs( - table2Data.CustomerDetails[0].OldCreditBal - )} -

    - ) : null} - - )} - - {/* CURRENT CREDIT BAL */} - {table2Data.CustomerDetails[0].CurrentCreditBal > - 0 ? ( -

    - {' '} - Current Advance Amount:{' '} - {table2Data.CustomerDetails[0].CurrentCreditBal} -

    - ) : table2Data.CustomerDetails[0].CurrentCreditBal < - 0 ? ( -

    - {' '} - Current Balance Amount:{' '} - {Math.abs( - table2Data.CustomerDetails[0].CurrentCreditBal - )} -

    - ) : null} -
    - )} -
    - -
    -
    -
    - Your Order No:{' '} - {GlobaldummyData - ? '53' - : table2Data?.SalesId && - extractLastNumber(table2Data?.SalesId)} -
    -
    - - {GlobaldummyData - ? GlobalQrcodet && ( -
    - image -
    - {' '} - Scan to Pay:{' '} -
    -
    - ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2) - ? Number(table2Data?.NetAmount).toFixed(2) - : 0} -
    -
    - ) - : !estimatePrintHeader && table2Data?.OrderType === 'E' - ? '' - : Qrcodet && - paymentTypeUPI && ( -
    - -
    - Scan to Pay{' '} -
    -
    - ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
    -
    - )} -
    - {sportsAppPreference && MembershipApplied && ( -
    {`*** Membership ${table2Data?.NetAmount === 0 ? 'Free Hours' : 'Discount'} Utilized - ${MembershipApplied?.Detail?.[0]?.MembershipName} ***`}
    - )} - -
    - {GlobaldummyData - ? GlobalIsnotes && ( -
    -

    - Notes : 10 days Return policy -

    - -
    -
    - ) - : !estimatePrintHeader && table2Data?.OrderType === 'E' - ? '' - : Notestext && ( -
    -

    - {Notestext} -

    - -
    -
    - )} - -
    - {GlobaldummyData - ? GlobaltermsAndConditions && ( -
    -

    - Terms & Conditions -

    -
      -
    1. - Once goods are sold, they are not - exchangeable or refundable. -
    2. -
    3. - Please check the product before leaving the - counter. -
    4. -
    -
    - ) - : !estimatePrintHeader && - table2Data?.OrderType === 'E' - ? '' - : TermsnAdCondition == true && - TermsAndConditions?.length > 0 && ( -
    -

    - Terms & Conditions -

    -
      - {TermsAndConditions?.map((item) => ( -
    1. - {item?.TermsandConditions} -
    2. - ))} - {/*
    3. Please check the product before leaving the counter.
    4. */} -
    -
    - )} - - {GlobaldummyData - ? GlobalSignature && ( -
    -

    - Signature -

    - -
    - ) - : !estimatePrintHeader && - table2Data?.OrderType === 'E' - ? '' - : Signature == true && ( -
    -

    - Signature -

    - -
    - )} -
    -
    - - {PrintGreeting?.SettingValue === 'Y' && ( -
    - Thank You Visit Again -
    - )} - - )} -
    - ))} - - {shouldFooterBeOnNewPage && FormatTheme && ( -
    -
    - <> -
    -
    -
    -
    -
    Items
    -
    :
    -
    - {GlobaldummyData ? '8' : totalQuantityFilter?.length} -
    -
    -
    -
    Qty
    -
    :
    -
    - {GlobaldummyData ? '9' : totalQuantity} -
    -
    - {(table2Data?.OverallDisc > 0 || - TotalOfferAmount > 0) && ( -
    -
    Off
    -
    :
    -
    - {GlobaldummyData - ? '9' - : Number( - TotalOfferAmount + table2Data?.OverallDisc - ).toFixed(2)} -
    -
    - )} - {/*
    -
    - Extra Charges -
    -
    :
    -
    - 0 -
    -
    */} - -
    - - {DineInData?.length > 0 && TakeawayData?.length > 0 && ( - <> - {takeAwayPreference && ( -
    -
    - TakeAway -
    -
    :
    -
    - {Number(TakeawayTotal).toFixed(2)} -
    -
    - )} - {dinePreference && ( -
    -
    - Dine In -
    -
    :
    -
    - {Number(DineInTotal).toFixed(2)} -
    -
    - )} - - )} -
    -
    - Amount -
    -
    :
    -
    - {GlobaldummyData - ? '1,066.00' - : Number(table2Data?.NetAmount).toFixed(2) - ? Number(table2Data?.NetAmount).toFixed(2) - : 0} -
    -
    - {PaymentStatusSuccess?.length > 1 && !isEditedBill && ( - <> - {/*

    Split Payment:

    */} - {Object.keys(aggregatedPayments).map( - (paymentType) => ( -
    - {paymentType}:{' '} - {aggregatedPayments[paymentType].toFixed(2)} -
    - ) - )} - - )} - {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( - '' - ) : ( -
    - {((OrderDetailGST?.length > 0 && - OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && - OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && - OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( - <> -
    -

    - --------- GST Breakup Details ----------- -

    - {OrderDetailGST?.length > 0 && - OrderDetailGST?.[0]?.TaxAmt > 0 && ( - - - - - - - - - {OrderDetailGST?.map((item) => ( - - - - - - - - ))} -
    - Taxable Amount - - CGST - - SGST - - Total Amount -
    - {item?.TaxPercentage || 0}% - - {Number( - item.WithOutTaxAmount - ).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - - {Number(item.TotalAmt).toFixed(2)} -
    - )} - - {OrderDetailIGST?.length > 0 && - OrderDetailIGST?.[0]?.TaxAmt > 0 && ( - <> -
    - - - - - - - - {OrderDetailIGST?.map((item) => ( - - - - - - - ))} -
    - Taxable Amount - - IGST - - Total Amount -
    - {item?.TaxPercentage || 0}% - - {Number( - item.WithOutTaxAmount - ).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - - {Number(item.TotalAmt).toFixed(2)} -
    - - )} - {OrderDetailVAT?.length > 0 && - OrderDetailVAT?.[0]?.TaxAmt > 0 && ( - <> -
    - - - - - - - - {OrderDetailVAT?.map((item) => ( - - - - - - - ))} -
    - Taxable Amount - - VAT - - Total Amount -
    - {item?.TaxPercentage || 0}% - - {Number( - item.WithOutTaxAmount - ).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - - {Number(item.TotalAmt).toFixed(2)} -
    - - )} -
    - - )}
    )}
    -
    Advance Amount:
    -
    Opening Balance:
    -
    - ) +
    +
    Advance Amount:
    +
    Opening Balance:
    +
    + ) : CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
    - {/* OLD CREDIT BAL */} - {PaymentStatusSuccess?.[0]?.PaymentTypeName === - 'Credit' && ( + table2Data?.CustomerDetails?.length > 0 && ( +
    + {/* OLD CREDIT BAL */} + {PaymentStatusSuccess?.[0]?.PaymentTypeName === + 'Credit' && ( <> {table2Data.CustomerDetails[0].OldCreditBal > - 0 ? ( + 0 ? (

    Advance Amount: {table2Data.CustomerDetails[0].OldCreditBal} @@ -2880,26 +2881,26 @@ const Printstyle12 = ({ )} - {/* CURRENT CREDIT BAL */} - {table2Data.CustomerDetails[0].CurrentCreditBal > + {/* CURRENT CREDIT BAL */} + {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( -

    - {' '} - Current Advance Amount:{' '} - {table2Data.CustomerDetails[0].CurrentCreditBal} -

    - ) : table2Data.CustomerDetails[0].CurrentCreditBal < - 0 ? ( -

    - {' '} - Current Balance Amount:{' '} - {Math.abs( - table2Data.CustomerDetails[0].CurrentCreditBal - )} -

    - ) : null} -
    - )} +

    + {' '} + Current Advance Amount:{' '} + {table2Data.CustomerDetails[0].CurrentCreditBal} +

    + ) : table2Data.CustomerDetails[0].CurrentCreditBal < + 0 ? ( +

    + {' '} + Current Balance Amount:{' '} + {Math.abs( + table2Data.CustomerDetails[0].CurrentCreditBal + )} +

    + ) : null} +
    + )}
    @@ -2914,78 +2915,78 @@ const Printstyle12 = ({ {GlobaldummyData ? '53' : table2Data?.SalesId && - extractLastNumber(table2Data?.SalesId)} + extractLastNumber(table2Data?.SalesId)}
    {GlobaldummyData ? GlobalQrcodet && ( -
    - image + image +
    + {' '} + Scan to Pay:{' '} +
    +
    + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2) + ? Number(table2Data?.NetAmount).toFixed(2) + : 0} +
    +
    + ) + : !estimatePrintHeader && table2Data?.OrderType === 'E' + ? '' + : Qrcodet && + paymentTypeUPI && ( +
    +
    - {' '} - Scan to Pay:{' '} + Scan to Pay{' '}
    - ₹ + ₹ {GlobaldummyData ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2) - ? Number(table2Data?.NetAmount).toFixed(2) - : 0} + : Number(table2Data?.NetAmount).toFixed(2)}
    - ) - : !estimatePrintHeader && table2Data?.OrderType === 'E' - ? '' - : Qrcodet && - paymentTypeUPI && ( -
    - -
    - Scan to Pay{' '} -
    -
    - ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
    -
    - )} + )}
    {sportsAppPreference && MembershipApplied && ( @@ -3010,25 +3011,25 @@ const Printstyle12 = ({ > {GlobaldummyData ? GlobalIsnotes && ( +
    +

    + Notes : 10 days Return policy +

    + +
    +
    + ) + : !estimatePrintHeader && table2Data?.OrderType === 'E' + ? '' + : Notestext && (

    - Notes : 10 days Return policy + {Notestext}


    - ) - : !estimatePrintHeader && table2Data?.OrderType === 'E' - ? '' - : Notestext && ( -
    -

    - {Notestext} -

    - -
    -
    - )} + )}
    {GlobaldummyData ? GlobaltermsAndConditions && ( +
    +

    + Terms & Conditions +

    +
      +
    1. + Once goods are sold, they are not exchangeable + or refundable. +
    2. +
    3. + Please check the product before leaving the + counter. +
    4. +
    +
    + ) + : !estimatePrintHeader && table2Data?.OrderType === 'E' + ? '' + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && (

    -

  • - Once goods are sold, they are not exchangeable - or refundable. -
  • -
  • - Please check the product before leaving the - counter. -
  • + {TermsAndConditions?.map((item) => ( +
  • + {item?.TermsandConditions} +
  • + ))} + {/*
  • Please check the product before leaving the counter.
  • */}
    - ) - : !estimatePrintHeader && table2Data?.OrderType === 'E' - ? '' - : TermsnAdCondition == true && - TermsAndConditions?.length > 0 && ( -
    -

    - Terms & Conditions -

    -
      - {TermsAndConditions?.map((item) => ( -
    1. - {item?.TermsandConditions} -
    2. - ))} - {/*
    3. Please check the product before leaving the counter.
    4. */} -
    -
    - )} + )} {GlobaldummyData ? GlobalSignature && ( +
    +

    + Signature +

    + +
    + ) + : !estimatePrintHeader && table2Data?.OrderType === 'E' + ? '' + : Signature == true && (
    @@ -3140,44 +3173,12 @@ const Printstyle12 = ({ Signature

    - ) - : !estimatePrintHeader && table2Data?.OrderType === 'E' - ? '' - : Signature == true && ( -
    -

    - Signature -

    - -
    - )} + )}
    @@ -3225,18 +3226,18 @@ const Printstyle12 = ({ {GlobaldummyData ? 'BranchAddress, Town- 635XXX City - State' : (table2Data?.AddressDetails?.[0]?.Address1 || '') + - (table2Data?.AddressDetails?.[0]?.City - ? (table2Data?.AddressDetails?.[0]?.Address1 && - table2Data?.AddressDetails?.[0]?.City - ? '-' - : '') + table2Data?.AddressDetails?.[0]?.City - : '') + - (table2Data?.AddressDetails?.[0]?.Zip - ? (table2Data?.AddressDetails?.[0]?.City && - table2Data?.AddressDetails?.[0]?.Zip - ? '-' - : '') + table2Data?.AddressDetails?.[0]?.Zip - : '')} + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')}
    {' '} @@ -3340,10 +3341,10 @@ const Printstyle12 = ({ {GlobaldummyData ? '553' : table2Data?.OrderId && - extractLastNumberOrderId( - table2Data?.OrderId, - table2Data?.FYStatus - )} + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}
    Des} {GlobaldummyData ? GlobalQuantity && ( - Qty - ) + Qty + ) : Quantity && ( - - {' '} - {WeightasKg ? 'Qty/Kg' : 'Qty'} - - )} + + {' '} + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + )} {GlobaldummyData ? GlobalMRP && ( - MRP - ) + MRP + ) : MRP && MRP} {GlobaldummyData ? GlobalRate && ( - Rate - ) + Rate + ) : Rate && Rate} {GlobaldummyData ? GlobalHsnCode && ( - HSN - ) + HSN + ) : HsnCode && ( - HSN - )} + HSN + )} {GlobaldummyData ? GlobalDiscount && ( - (%) - ) + (%) + ) : Discount && ( - (%) - )} + (%) + )} {GlobaldummyData ? GlobalTax && ( - Tax (%) - ) + Tax (%) + ) : Tax && - table2Data?.OrderType !== 'E' && ( - Tax (%) - )} + table2Data?.OrderType !== 'E' && ( + Tax (%) + )} {GlobaldummyData ? GlobalAmount && ( - Amt - ) + Amt + ) : Amount && Amt} @@ -3442,195 +3443,195 @@ const Printstyle12 = ({ {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item && ( - -
    {item?.ProdName}
    - {PackageDetails?.filter( - (pkg) => pkg.ProdId === item.ProdId - ).length > 0 ? ( -
    - {PackageDetails?.filter( - (pkg) => pkg.ProdId === item.ProdId - )?.map((item, index) => ( - - {item.ParcelCount} PCS{' '} - {item.ParcelQty} PACK ( - {item.ParcelType}) - - ))} - {item?.BrandName !== null - ? item?.BrandName - : ''} -   - {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls?.filter( - (items) => - !( - items.SerialNumber == '' || - items.SerialNumber == null - ) - )?.map((a) => { - return ( -
    {a.SerialNumber}
    - ); - }) - : ''}{' '} - {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (item1) => - item1.IMEI1 !== '' || - item1.IMEI2 !== '' - )?.map((item2) => { - const imei1 = item2.IMEI1 || ''; - const imei2 = item2.IMEI2 || ''; - return ( -
    - {[imei1, imei2] - .filter(Boolean) - .join(',')} -
    - ); - }) - : ''} -
    - ) : ( -
    - ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) - {item?.BrandName !== null - ? item?.BrandName - : ''} -   - {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls?.filter( - (items) => - !( - items.SerialNumber == '' || - items.SerialNumber == null - ) - )?.map((a) => { - return ( -
    {a.SerialNumber}
    - ); - }) - : ''}{' '} - {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (item1) => - item1.IMEI1 !== '' || - item1.IMEI2 !== '' - )?.map((item2) => { - const imei1 = item2.IMEI1 || ''; - const imei2 = item2.IMEI2 || ''; - return ( -
    - {[imei1, imei2] - .filter(Boolean) - .join(',')} -
    - ); - }) - : ''} -
    - )} - - )} + +
    {item?.ProdName}
    + {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + ).length > 0 ? ( +
    + {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + )?.map((item, index) => ( + + {item.ParcelCount} PCS{' '} + {item.ParcelQty} PACK ( + {item.ParcelType}) + + ))} + {item?.BrandName !== null + ? item?.BrandName + : ''} +   + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls?.filter( + (items) => + !( + items.SerialNumber == '' || + items.SerialNumber == null + ) + )?.map((a) => { + return ( +
    {a.SerialNumber}
    + ); + }) + : ''}{' '} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
    + {[imei1, imei2] + .filter(Boolean) + .join(',')} +
    + ); + }) + : ''} +
    + ) : ( +
    + ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) + {item?.BrandName !== null + ? item?.BrandName + : ''} +   + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls?.filter( + (items) => + !( + items.SerialNumber == '' || + items.SerialNumber == null + ) + )?.map((a) => { + return ( +
    {a.SerialNumber}
    + ); + }) + : ''}{' '} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
    + {[imei1, imei2] + .filter(Boolean) + .join(',')} +
    + ); + }) + : ''} +
    + )} + + )} {GlobaldummyData ? GlobalQuantity && ( - - {item?.SalesQty} - - ) + + {item?.SalesQty} + + ) : Quantity && ( - - {item?.SalesQty} - - )} + + {item?.SalesQty} + + )} {GlobaldummyData ? GlobalMRP && ( - - {item?.MRP} - - ) + + {item?.MRP} + + ) : MRP && ( - - {item?.SinglePc === 'Y' - ? item?.Rate - : item?.MRP} - - )} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + )} {GlobaldummyData ? GlobalRate && ( - - {item?.Rate} - - ) + + {item?.Rate} + + ) : Rate && ( - - {item?.Rate} - - )} + + {item?.Rate} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - - ) + + {item?.HSN} + + ) : HsnCode && ( - - {item?.HSN} - - )} + + {item?.HSN} + + )} {GlobaldummyData ? GlobalDiscount && ( - - {item?.discount} - - ) + + {item?.discount} + + ) : Discount && ( - - {item?.Type != 'C' - ? item?.OfferAmt || 0 - : item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} {GlobaldummyData ? GlobalTax && ( - - {item?.ProdTaxPercentage} - - ) + + {item?.ProdTaxPercentage} + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - {item?.ProdTaxPercentage || 0} - - )} + table2Data?.OrderType !== 'E' && ( + + {item?.ProdTaxPercentage || 0} + + )} {GlobaldummyData ? GlobalAmount && ( - - {item?.TotalAmt} - - ) + + {item?.TotalAmt} + + ) : Amount && ( - - {item?.Type != 'C' - ? item?.TotalAmt - item?.OfferAmt || 0 - : item?.TotalAmt - item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} + + )} ); } @@ -3666,50 +3667,50 @@ const Printstyle12 = ({ : Item && Des} {GlobaldummyData ? GlobalQuantity && ( - Qty - ) + Qty + ) : Quantity && ( - - {' '} - {WeightasKg ? 'Qty/Kg' : 'Qty'} - - )} + + {' '} + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + )} {GlobaldummyData ? GlobalMRP && ( - MRP - ) + MRP + ) : MRP && MRP} {GlobaldummyData ? GlobalRate && ( - Rate - ) + Rate + ) : Rate && Rate} {GlobaldummyData ? GlobalHsnCode && ( - HSN - ) + HSN + ) : HsnCode && ( - HSN - )} + HSN + )} {GlobaldummyData ? GlobalDiscount && ( - (%) - ) + (%) + ) : Discount && ( - (%) - )} + (%) + )} {GlobaldummyData ? GlobalTax && ( - Tax (%) - ) + Tax (%) + ) : Tax && - table2Data?.OrderType !== 'E' && ( - Tax (%) - )} + table2Data?.OrderType !== 'E' && ( + Tax (%) + )} {GlobaldummyData ? GlobalAmount && ( - Amt - ) + Amt + ) : Amount && Amt} @@ -3724,108 +3725,108 @@ const Printstyle12 = ({ {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item && ( - -
    {item?.ProdName}
    -
    - ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) -
    - - )} + +
    {item?.ProdName}
    +
    + ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) +
    + + )} {GlobaldummyData ? GlobalQuantity && ( - - {item?.SalesQty} - - ) + + {item?.SalesQty} + + ) : Quantity && ( - - {item?.SalesQty} - - )} + + {item?.SalesQty} + + )} {GlobaldummyData ? GlobalMRP && ( - - {item?.MRP} - - ) + + {item?.MRP} + + ) : MRP && ( - - {item?.SinglePc === 'Y' - ? item?.Rate - : item?.MRP} - - )} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + )} {GlobaldummyData ? GlobalRate && ( - - {item?.Rate} - - ) + + {item?.Rate} + + ) : Rate && ( - - {item?.Rate} - - )} + + {item?.Rate} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - - ) + + {item?.HSN} + + ) : HsnCode && ( - - {item?.HSN} - - )} + + {item?.HSN} + + )} {GlobaldummyData ? GlobalDiscount && ( - - {item?.discount} - - ) + + {item?.discount} + + ) : Discount && ( - - {item?.Type != 'C' - ? item?.OfferAmt || 0 - : item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} {GlobaldummyData ? GlobalTax && ( - - {item?.ProdTaxPercentage} - - ) + + {item?.ProdTaxPercentage} + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - {item?.ProdTaxPercentage || 0} - - )} + table2Data?.OrderType !== 'E' && ( + + {item?.ProdTaxPercentage || 0} + + )} {GlobaldummyData ? GlobalAmount && ( - - {item?.TotalAmt} - - ) + + {item?.TotalAmt} + + ) : Amount && ( - - {item?.Type != 'C' - ? item?.TotalAmt - item?.OfferAmt || 0 - : item?.TotalAmt - item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} + + )} ); } @@ -3892,8 +3893,8 @@ const Printstyle12 = ({ {GlobaldummyData ? '9' : Number( - TotalOfferAmount + table2Data?.OverallDisc - ).toFixed(2)} + TotalOfferAmount + table2Data?.OverallDisc + ).toFixed(2)}
    )} @@ -4010,118 +4011,20 @@ const Printstyle12 = ({ OrderDetailIGST?.[0]?.TaxAmt > 0) || (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( - <> -
    -

    - --------- GST Breakup Details ----------- -

    - {OrderDetailGST?.length > 0 && - OrderDetailGST?.[0]?.TaxAmt > 0 && ( - - - - - - - - - {OrderDetailGST?.map((item) => ( - - - - - - - - ))} -
    - Taxable Amount - - CGST - - SGST - - Total Amount -
    - {item?.TaxPercentage || 0}% - - {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - - {Number(item.TotalAmt).toFixed(2)} -
    - )} - - {OrderDetailIGST?.length > 0 && - OrderDetailIGST?.[0]?.TaxAmt > 0 && ( - <> -
    + <> +
    +

    + --------- GST Breakup Details ----------- +

    + {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + - {OrderDetailIGST?.map((item) => ( + {OrderDetailGST?.map((item) => ( + -
    - IGST + CGST + + SGST
    - {Number(item.TaxAmt).toFixed(2)} + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} ))}
    - - )} - {OrderDetailVAT?.length > 0 && - OrderDetailVAT?.[0]?.TaxAmt > 0 && ( - <> -
    - - - - - - - - {OrderDetailVAT?.map((item) => ( + )} + + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
    +
    - Taxable Amount - - VAT - - Total Amount -
    + - - ))} -
    - {item?.TaxPercentage || 0}% + Taxable Amount - {Number(item.WithOutTaxAmount).toFixed(2)} + IGST - {Number(item.TaxAmt).toFixed(2)} - - {Number(item.TotalAmt).toFixed(2)} + Total Amount
    - - )} -
    - - )} + {OrderDetailIGST?.map((item) => ( + + + {item?.TaxPercentage || 0}% + + + {Number(item.WithOutTaxAmount).toFixed(2)} + + + {Number(item.TaxAmt).toFixed(2)} + + + + {Number(item.TotalAmt).toFixed(2)} + + + ))} + + + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
    + + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
    + Taxable Amount + + VAT + + Total Amount +
    + {item?.TaxPercentage || 0}% + + {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
    + + )} +
    + + )} )}
    -
    Advance Amount:
    -
    Opening Balance:
    - - ) +
    +
    Advance Amount:
    +
    Opening Balance:
    +
    + ) : CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
    - {/* OLD CREDIT BAL */} - {PaymentStatusSuccess?.[0]?.PaymentTypeName === 'Credit' && ( - <> - {table2Data.CustomerDetails[0].OldCreditBal > 0 ? ( -

    - Advance Amount: - {table2Data.CustomerDetails[0].OldCreditBal} -

    - ) : table2Data.CustomerDetails[0].OldCreditBal < 0 ? ( -

    - {' '} - Opening Balance:{' '} - {Math.abs(table2Data.CustomerDetails[0].OldCreditBal)} -

    - ) : null} - - )} + table2Data?.CustomerDetails?.length > 0 && ( +
    + {/* OLD CREDIT BAL */} + {PaymentStatusSuccess?.[0]?.PaymentTypeName === 'Credit' && ( + <> + {table2Data.CustomerDetails[0].OldCreditBal > 0 ? ( +

    + Advance Amount: + {table2Data.CustomerDetails[0].OldCreditBal} +

    + ) : table2Data.CustomerDetails[0].OldCreditBal < 0 ? ( +

    + {' '} + Opening Balance:{' '} + {Math.abs(table2Data.CustomerDetails[0].OldCreditBal)} +

    + ) : null} + + )} - {/* CURRENT CREDIT BAL */} - {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( -

    - {' '} - Current Advance Amount:{' '} - {table2Data.CustomerDetails[0].CurrentCreditBal} -

    - ) : table2Data.CustomerDetails[0].CurrentCreditBal < 0 ? ( -

    - {' '} - Current Balance Amount:{' '} - {Math.abs(table2Data.CustomerDetails[0].CurrentCreditBal)} -

    - ) : null} -
    - )} + {/* CURRENT CREDIT BAL */} + {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( +

    + {' '} + Current Advance Amount:{' '} + {table2Data.CustomerDetails[0].CurrentCreditBal} +

    + ) : table2Data.CustomerDetails[0].CurrentCreditBal < 0 ? ( +

    + {' '} + Current Balance Amount:{' '} + {Math.abs(table2Data.CustomerDetails[0].CurrentCreditBal)} +

    + ) : null} +
    + )}
    @@ -4487,70 +4488,70 @@ const Printstyle12 = ({ {GlobaldummyData ? '53' : table2Data?.SalesId && - extractLastNumber(table2Data?.SalesId)} + extractLastNumber(table2Data?.SalesId)}
    {GlobaldummyData ? GlobalQrcodet && ( -
    - image -
    - {' '} - Scan to Pay:{' '} -
    -
    - ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2) - ? Number(table2Data?.NetAmount).toFixed(2) - : 0} -
    +
    + image +
    + {' '} + Scan to Pay:{' '}
    - ) +
    + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2) + ? Number(table2Data?.NetAmount).toFixed(2) + : 0} +
    +
    + ) : !estimatePrintHeader && table2Data?.OrderType === 'E' ? '' : Qrcodet && - paymentTypeUPI && ( -
    - -
    - Scan to Pay{' '} -
    -
    - ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
    + paymentTypeUPI && ( +
    + +
    + Scan to Pay{' '}
    - )} +
    + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
    +
    + )}
    {sportsAppPreference && MembershipApplied && (
    {GlobaldummyData ? GlobalIsnotes && ( -
    -

    - Notes : 10 days Return policy -

    +
    +

    + Notes : 10 days Return policy +

    -
    -
    - ) +
    +
    + ) : !estimatePrintHeader && table2Data?.OrderType === 'E' ? '' : Notestext && ( -
    -

    {Notestext}

    +
    +

    {Notestext}

    -
    -
    - )} +
    +
    + )}
    {GlobaldummyData ? GlobaltermsAndConditions && ( +
    +

    + Terms & Conditions +

    +
      +
    1. + Once goods are sold, they are not exchangeable or + refundable. +
    2. +
    3. + Please check the product before leaving the counter. +
    4. +
    +
    + ) + : !estimatePrintHeader && table2Data?.OrderType === 'E' + ? '' + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && (

    -

  • - Once goods are sold, they are not exchangeable or - refundable. -
  • -
  • - Please check the product before leaving the counter. -
  • + {TermsAndConditions?.map((item) => ( +
  • + {item?.TermsandConditions} +
  • + ))} + {/*
  • Please check the product before leaving the counter.
  • */}
    - ) - : !estimatePrintHeader && table2Data?.OrderType === 'E' - ? '' - : TermsnAdCondition == true && - TermsAndConditions?.length > 0 && ( -
    -

    - Terms & Conditions -

    -
      - {TermsAndConditions?.map((item) => ( -
    1. - {item?.TermsandConditions} -
    2. - ))} - {/*
    3. Please check the product before leaving the counter.
    4. */} -
    -
    - )} + )} {GlobaldummyData ? GlobalSignature && ( +
    +

    + Signature +

    + +
    + ) + : !estimatePrintHeader && table2Data?.OrderType === 'E' + ? '' + : Signature == true && (
    @@ -4706,44 +4739,12 @@ const Printstyle12 = ({ Signature

    - ) - : !estimatePrintHeader && table2Data?.OrderType === 'E' - ? '' - : Signature == true && ( -
    -

    - Signature -

    - -
    - )} + )}
    diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.jsx index f4ea976..e05dd88 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.jsx @@ -103,6 +103,7 @@ const Printstyle6 = ({ const GlobalLogo = useSelector(GlobalprintLogo); const GlobalCredit = useSelector(GlobalprintCredit); const SettingData = useSelector(PreferenceData); + const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor); console.log(CashierNameField, "GlobaldummyData") const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find( @@ -3267,7 +3268,7 @@ const Printstyle6 = ({ /> ) : null}
    -
    +
    {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
    diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.jsx index 6d67baa..9cb2131 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.jsx @@ -99,6 +99,7 @@ const PrintStyle7 = ({ const GlobalLogo = useSelector(GlobalprintLogo); const GlobalCredit = useSelector(GlobalprintCredit); const SettingData = useSelector(PreferenceData); + const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor); const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find( (setting) => @@ -366,8 +367,8 @@ const PrintStyle7 = ({ flexDirection: 'column', justifyContent: chunkIndex === paginatedChunks.length - 1 && - !shouldFooterBeOnNewPage && - FormatTheme + !shouldFooterBeOnNewPage && + FormatTheme ? 'space-between' : '', height: isMobile @@ -416,7 +417,7 @@ const PrintStyle7 = ({ /> ) : null} {base64Image && - (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( + (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( {table2Data?.OrderType === 'E' && (
    @@ -562,80 +563,80 @@ const PrintStyle7 = ({ {GlobaldummyData ? GlobalSlNo && ( - S - ) + S + ) : SLNO == true && ( - S - )} + S + )} {GlobaldummyData ? GlobalItem && Item : Item == true && Item} {GlobaldummyData ? GlobalHsnCode && ( - HSN - ) + HSN + ) : HsnCode == true && ( - HSN - )} + HSN + )} {GlobaldummyData ? GlobalQuantity && ( - Qty - ) + Qty + ) : Quantity == true && ( - - {WeightasKg ? 'Qty/Kg' : 'Qty'} - - )} + + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + )} {GlobaldummyData ? GlobalMRP && ( - MRP - ) + MRP + ) : MRP == true && ( - MRP - )} + MRP + )} {GlobaldummyData ? GlobalRate && ( - Rate - ) + Rate + ) : Rate == true && ( - Rate - )} + Rate + )} {GlobaldummyData ? GlobalDiscount && ( - Dis - ) + Dis + ) : Discount == true && ( - Dis - )} + Dis + )} {GlobaldummyData ? GlobalTax && ( - Tax % - ) + Tax % + ) : Tax && - table2Data?.OrderType !== 'E' && ( - Tax % - )} + table2Data?.OrderType !== 'E' && ( + Tax % + )} {GlobaldummyData ? GlobalAmount && ( - - Amt - - ) + + Amt + + ) : Amount == true && ( - - Amt - - )} + + Amt + + )} @@ -643,137 +644,137 @@ const PrintStyle7 = ({ {GlobaldummyData ? GlobalSlNo && ( - - {index + 1} - - ) + + {index + 1} + + ) : SLNO == true && ( - - {chunkIndex * chunkSize + index + 1} - - )} + + {chunkIndex * chunkSize + index + 1} + + )} {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item == true && ( - -
    {item?.ProdName}
    - {PackageDetails?.filter( - (pkg) => pkg.ProdId === item.ProdId - ).length > 0 ? ( -
    - {PackageDetails?.filter( - (pkg) => - pkg.ProdId === item.ProdId - )?.map((item, index) => ( - - {item.ParcelCount} PCS{' '} - {item.ParcelQty} PACK ( - {item.ParcelType}) - - ))} -
    - ) : ( -
    - ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) -
    - )} - - )} + +
    {item?.ProdName}
    + {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + ).length > 0 ? ( +
    + {PackageDetails?.filter( + (pkg) => + pkg.ProdId === item.ProdId + )?.map((item, index) => ( + + {item.ParcelCount} PCS{' '} + {item.ParcelQty} PACK ( + {item.ParcelType}) + + ))} +
    + ) : ( +
    + ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) +
    + )} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - - ) + + {item?.HSN} + + ) : HsnCode == true && ( - - {item?.HSN} - - )} + + {item?.HSN} + + )} {GlobaldummyData ? GlobalQuantity && ( - - {item?.SalesQty} - - ) + + {item?.SalesQty} + + ) : Quantity == true && ( - - {item?.SalesQty} - - )} + + {item?.SalesQty} + + )} {GlobaldummyData ? GlobalMRP && ( - - {item?.MRP} - - ) + + {item?.MRP} + + ) : MRP == true && ( - - {item?.SinglePc === 'Y' - ? item?.Rate - : item?.MRP} - - )} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + )} {GlobaldummyData ? GlobalRate && ( - - {item?.Rate} - - ) + + {item?.Rate} + + ) : Rate == true && ( - - {item?.Rate} - - )} + + {item?.Rate} + + )} {GlobaldummyData ? GlobalDiscount && {item.discount} : Discount == true && ( - - {item?.Type != 'C' - ? item?.OfferAmt || 0 - : item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} {GlobaldummyData ? GlobalTax && ( - - {item?.ProdTaxPercentage} - - ) + + {item?.ProdTaxPercentage} + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - {item?.ProdTaxPercentage || 0} - - )} + table2Data?.OrderType !== 'E' && ( + + {item?.ProdTaxPercentage || 0} + + )} {GlobaldummyData ? GlobalAmount && ( - - {item?.TotalAmt} - - ) + + {item?.TotalAmt} + + ) : Amount == true && ( - - {item?.Type != 'C' - ? item?.TotalAmt - item?.OfferAmt || 0 - : item?.TotalAmt - item?.OfferValue || - 0} - - )} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || + 0} + + )} ))} @@ -802,80 +803,80 @@ const PrintStyle7 = ({ {GlobaldummyData ? GlobalSlNo && ( - S.No - ) + S.No + ) : SLNO == true && ( - S.NO - )} + S.NO + )} {GlobaldummyData ? GlobalItem && Item : Item == true && Item} {GlobaldummyData ? GlobalHsnCode && ( - HSN - ) + HSN + ) : HsnCode == true && ( - HSN - )} + HSN + )} {GlobaldummyData ? GlobalQuantity && ( - Qty - ) + Qty + ) : Quantity == true && ( - - {WeightasKg ? 'Qty/Kg' : 'Qty'} - - )} + + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + )} {GlobaldummyData ? GlobalMRP && ( - MRP - ) + MRP + ) : MRP == true && ( - MRP - )} + MRP + )} {GlobaldummyData ? GlobalRate && ( - Rate - ) + Rate + ) : Rate == true && ( - Rate - )} + Rate + )} {GlobaldummyData ? GlobalDiscount && ( - Dis - ) + Dis + ) : Discount == true && ( - Dis - )} + Dis + )} {GlobaldummyData ? GlobalTax && ( - Tax % - ) + Tax % + ) : Tax && - table2Data?.OrderType !== 'E' && ( - Tax % - )} + table2Data?.OrderType !== 'E' && ( + Tax % + )} {GlobaldummyData ? GlobalAmount && ( - - Amt - - ) + + Amt + + ) : Amount == true && ( - - Amt - - )} + + Amt + + )} @@ -883,153 +884,153 @@ const PrintStyle7 = ({ {GlobaldummyData ? GlobalSlNo && ( - - {index + 1} - - ) + + {index + 1} + + ) : SLNO == true && ( - - {chunkIndex * chunkSize + index + 1} - - )} + + {chunkIndex * chunkSize + index + 1} + + )} {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item == true && ( - -
    {item?.ProdName}
    -
    - ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) - {item?.BrandName !== null - ? item?.BrandName - : ''} -   - {item?.ProductIdentifierDtls?.length > + +
    {item?.ProdName}
    +
    + ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) + {item?.BrandName !== null + ? item?.BrandName + : ''} +   + {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls?.filter( - (items) => - !( - items.SerialNumber == '' || - items.SerialNumber == null - ) - )?.map((a) => { - return ( -
    {a.SerialNumber}
    - ); - }) - : ''}{' '} - {item?.ProductIdentifierDtls?.length > + ? item?.ProductIdentifierDtls?.filter( + (items) => + !( + items.SerialNumber == '' || + items.SerialNumber == null + ) + )?.map((a) => { + return ( +
    {a.SerialNumber}
    + ); + }) + : ''}{' '} + {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (item1) => - item1.IMEI1 !== '' || - item1.IMEI2 !== '' - )?.map((item2) => { - const imei1 = item2.IMEI1 || ''; - const imei2 = item2.IMEI2 || ''; - return ( -
    - {[imei1, imei2] - .filter(Boolean) - .join(',')} -
    - ); - }) - : ''} -
    - - )} + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
    + {[imei1, imei2] + .filter(Boolean) + .join(',')} +
    + ); + }) + : ''} +
    + + )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - - ) + + {item?.HSN} + + ) : HsnCode == true && ( - - {item?.HSN} - - )} + + {item?.HSN} + + )} {GlobaldummyData ? GlobalQuantity && ( - - {item?.SalesQty} - - ) + + {item?.SalesQty} + + ) : Quantity == true && ( - - {item?.SalesQty} - - )} + + {item?.SalesQty} + + )} {GlobaldummyData ? GlobalMRP && ( - - {item?.MRP} - - ) + + {item?.MRP} + + ) : MRP == true && ( - - {item?.SinglePc === 'Y' - ? item?.Rate - : item?.MRP} - - )} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + )} {GlobaldummyData ? GlobalRate && ( - - {item?.Rate} - - ) + + {item?.Rate} + + ) : Rate == true && ( - - {item?.Rate} - - )} + + {item?.Rate} + + )} {GlobaldummyData ? GlobalDiscount && {item.discount} : Discount == true && ( - - {item?.Type != 'C' - ? item?.OfferAmt || 0 - : item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} {GlobaldummyData ? GlobalTax && ( - - {item?.ProdTaxPercentage} - - ) + + {item?.ProdTaxPercentage} + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - {item?.ProdTaxPercentage || 0} - - )} + table2Data?.OrderType !== 'E' && ( + + {item?.ProdTaxPercentage || 0} + + )} {GlobaldummyData ? GlobalAmount && ( - - {item?.TotalAmt} - - ) + + {item?.TotalAmt} + + ) : Amount == true && ( - - {item?.Type != 'C' - ? item?.TotalAmt - item?.OfferAmt || 0 - : item?.TotalAmt - item?.OfferValue || - 0} - - )} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || + 0} + + )} ))} @@ -1055,15 +1056,15 @@ const PrintStyle7 = ({
    {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && ( -
    - Off :{' '} - {GlobaldummyData - ? '10' - : Number( +
    + Off :{' '} + {GlobaldummyData + ? '10' + : Number( TotalOfferAmount + table2Data?.OverallDisc ).toFixed(2)} -
    - )} +
    + )}
    -
    Advance Amount:
    -
    Opening Balance:
    -
    - ) +
    +
    Advance Amount:
    +
    Opening Balance:
    +
    + ) : CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
    - {/* OLD CREDIT BAL */} - {PaymentStatusSuccess?.[0]?.PaymentTypeName === - 'Credit' && ( + table2Data?.CustomerDetails?.length > 0 && ( +
    + {/* OLD CREDIT BAL */} + {PaymentStatusSuccess?.[0]?.PaymentTypeName === + 'Credit' && ( <> {table2Data.CustomerDetails[0].OldCreditBal > - 0 ? ( + 0 ? (

    Advance Amount: {table2Data.CustomerDetails[0].OldCreditBal} @@ -1572,26 +1573,26 @@ const PrintStyle7 = ({ )} - {/* CURRENT CREDIT BAL */} - {table2Data.CustomerDetails[0].CurrentCreditBal > + {/* CURRENT CREDIT BAL */} + {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( -

    - {' '} - Current Advance Amount:{' '} - {table2Data.CustomerDetails[0].CurrentCreditBal} -

    - ) : table2Data.CustomerDetails[0].CurrentCreditBal < - 0 ? ( -

    - {' '} - Current Balance Amount:{' '} - {Math.abs( - table2Data.CustomerDetails[0].CurrentCreditBal - )} -

    - ) : null} -
    - )} +

    + {' '} + Current Advance Amount:{' '} + {table2Data.CustomerDetails[0].CurrentCreditBal} +

    + ) : table2Data.CustomerDetails[0].CurrentCreditBal < + 0 ? ( +

    + {' '} + Current Balance Amount:{' '} + {Math.abs( + table2Data.CustomerDetails[0].CurrentCreditBal + )} +

    + ) : null} +
    + )} {GlobaldummyData && GlobalCashierName && (
    {GlobaldummyData ? GlobalQrcodet && ( -
    - QRcode -
    - Scan to Pay{' '} -
    -
    - ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
    +
    + QRcode +
    + Scan to Pay{' '}
    - ) +
    + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
    +
    + ) : Qrcodet && - paymentTypeUPI && ( -
    - -
    - Scan to Pay{' '} -
    -
    - ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
    + paymentTypeUPI && ( +
    + +
    + Scan to Pay{' '}
    - )} +
    + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
    +
    + )}
    )} @@ -1747,23 +1748,23 @@ const PrintStyle7 = ({
    {GlobaldummyData ? GlobalIsnotes && ( -
    -

    - Notes : 10 days Return policy -

    +
    +

    + Notes : 10 days Return policy +

    -
    -
    - ) +
    +
    + ) : Notestext && ( -
    -

    - {Notestext} -

    +
    +

    + {Notestext} +

    -
    -
    - )} +
    +
    + )}
    )} @@ -1783,137 +1784,137 @@ const PrintStyle7 = ({ > {GlobaldummyData ? GlobaltermsAndConditions && ( -
    +

    -

    - Terms & Conditions -

    -
      -
    1. - Once goods are sold, they are not - exchangeable or refundable. -
    2. -
    3. - Please check the product before leaving - the counter. -
    4. -
    -
    - ) + Terms & Conditions +

    +
      +
    1. + Once goods are sold, they are not + exchangeable or refundable. +
    2. +
    3. + Please check the product before leaving + the counter. +
    4. +
    +
    + ) : TermsnAdCondition == true && - TermsAndConditions?.length > 0 && ( -
    0 && ( +
    +

    -

    - Terms & Conditions -

    -
      - {TermsAndConditions?.map((item) => ( -
    1. - {item?.TermsandConditions} -
    2. - ))} - {/*
    3. Please check the product before leaving the counter.
    4. */} -
    -
    - )} + Terms & Conditions +

    +
      + {TermsAndConditions?.map((item) => ( +
    1. + {item?.TermsandConditions} +
    2. + ))} + {/*
    3. Please check the product before leaving the counter.
    4. */} +
    +
    + )} {GlobaldummyData ? GlobalSignature && ( -
    +

    -

    - Signature -

    - -
    - ) + Signature +

    + +
    + ) : Signature == true && ( -
    +

    -

    - Signature -

    - -
    - )} + Signature +

    + +
    + )} )} @@ -1970,15 +1971,15 @@ const PrintStyle7 = ({ {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && ( -
    - Off :{' '} - {GlobaldummyData - ? '10' - : Number( +
    + Off :{' '} + {GlobaldummyData + ? '10' + : Number( TotalOfferAmount + table2Data?.OverallDisc ).toFixed(2)} -
    - )} +
    + )}
    {table2Data?.OrderType === 'E' ? ( @@ -2431,34 +2432,34 @@ const PrintStyle7 = ({ {GlobaldummyData ? GlobalCredit && ( -
    -
    Advance Amount:
    -
    Opening Balance:
    -
    - ) +
    +
    Advance Amount:
    +
    Opening Balance:
    +
    + ) : CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
    - {/* OLD CREDIT BAL */} - {PaymentStatusSuccess?.[0]?.PaymentTypeName === - 'Credit' && ( + table2Data?.CustomerDetails?.length > 0 && ( +
    + {/* OLD CREDIT BAL */} + {PaymentStatusSuccess?.[0]?.PaymentTypeName === + 'Credit' && ( <> {table2Data.CustomerDetails[0].OldCreditBal > - 0 ? ( + 0 ? (

    Advance Amount: {table2Data.CustomerDetails[0].OldCreditBal} @@ -2476,26 +2477,26 @@ const PrintStyle7 = ({ )} - {/* CURRENT CREDIT BAL */} - {table2Data.CustomerDetails[0].CurrentCreditBal > + {/* CURRENT CREDIT BAL */} + {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( -

    - {' '} - Current Advance Amount:{' '} - {table2Data.CustomerDetails[0].CurrentCreditBal} -

    - ) : table2Data.CustomerDetails[0].CurrentCreditBal < - 0 ? ( -

    - {' '} - Current Balance Amount:{' '} - {Math.abs( - table2Data.CustomerDetails[0].CurrentCreditBal - )} -

    - ) : null} -
    - )} +

    + {' '} + Current Advance Amount:{' '} + {table2Data.CustomerDetails[0].CurrentCreditBal} +

    + ) : table2Data.CustomerDetails[0].CurrentCreditBal < + 0 ? ( +

    + {' '} + Current Balance Amount:{' '} + {Math.abs( + table2Data.CustomerDetails[0].CurrentCreditBal + )} +

    + ) : null} +
    + )} {GlobaldummyData && GlobalCashierName && (
    {GlobaldummyData ? GlobalQrcodet && ( -
    - QRcode -
    - Scan to Pay{' '} -
    -
    - ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
    +
    + QRcode +
    + Scan to Pay{' '}
    - ) +
    + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
    +
    + ) : Qrcodet && - paymentTypeUPI && ( -
    - -
    - Scan to Pay{' '} -
    -
    - ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
    + paymentTypeUPI && ( +
    + +
    + Scan to Pay{' '}
    - )} +
    + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
    +
    + )}
    )} @@ -2651,23 +2652,23 @@ const PrintStyle7 = ({
    {GlobaldummyData ? GlobalIsnotes && ( -
    -

    - Notes : 10 days Return policy -

    +
    +

    + Notes : 10 days Return policy +

    -
    -
    - ) +
    +
    + ) : Notestext && ( -
    -

    - {Notestext} -

    +
    +

    + {Notestext} +

    -
    -
    - )} +
    +
    + )}
    )} @@ -2687,137 +2688,137 @@ const PrintStyle7 = ({ > {GlobaldummyData ? GlobaltermsAndConditions && ( -
    +

    -

    - Terms & Conditions -

    -
      -
    1. - Once goods are sold, they are not - exchangeable or refundable. -
    2. -
    3. - Please check the product before leaving the - counter. -
    4. -
    -
    - ) + Terms & Conditions +

    +
      +
    1. + Once goods are sold, they are not + exchangeable or refundable. +
    2. +
    3. + Please check the product before leaving the + counter. +
    4. +
    +
    + ) : TermsnAdCondition == true && - TermsAndConditions?.length > 0 && ( -
    0 && ( +
    +

    -

    - Terms & Conditions -

    -
      - {TermsAndConditions?.map((item) => ( -
    1. - {item?.TermsandConditions} -
    2. - ))} - {/*
    3. Please check the product before leaving the counter.
    4. */} -
    -
    - )} + Terms & Conditions +

    +
      + {TermsAndConditions?.map((item) => ( +
    1. + {item?.TermsandConditions} +
    2. + ))} + {/*
    3. Please check the product before leaving the counter.
    4. */} +
    +
    + )} {GlobaldummyData ? GlobalSignature && ( -
    +

    -

    - Signature -

    - -
    - ) + Signature +

    + +
    + ) : Signature == true && ( -
    +

    -

    - Signature -

    - -
    - )} + Signature +

    + +
    + )}
    )} @@ -2868,7 +2869,7 @@ const PrintStyle7 = ({ /> ) : null} {base64Image && - (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( + (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( {table2Data?.OrderType === 'E' && (
    @@ -3016,59 +3017,59 @@ const PrintStyle7 = ({ {GlobaldummyData ? GlobalSlNo && S.No : SLNO == true && ( - S.No - )} + S.No + )} {GlobaldummyData ? GlobalItem && ( - - Item - - ) + + Item + + ) : Item == true && Item} {GlobaldummyData ? GlobalHsnCode && HSN : HsnCode == true && ( - HSN - )} + HSN + )} {GlobaldummyData ? GlobalQuantity && Qty : Quantity == true && ( - - {WeightasKg ? 'Qty/Kg' : 'Qty'} - - )} + + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + )} {GlobaldummyData ? GlobalMRP && MRP : MRP == true && ( - MRP - )} + MRP + )} {GlobaldummyData ? GlobalRate && Rate : Rate == true && ( - Rate - )} + Rate + )} {GlobaldummyData ? GlobalDiscount && Dis : Discount == true && ( - Dis - )} + Dis + )} {GlobaldummyData ? GlobalTax && ( - Tax % - ) + Tax % + ) : Tax && - table2Data?.OrderType !== 'E' && ( - Tax % - )} + table2Data?.OrderType !== 'E' && ( + Tax % + )} {GlobaldummyData ? GlobalAmount && ( - Amt - ) + Amt + ) : Amount == true && ( - - Amt - - )} + + Amt + + )} @@ -3077,135 +3078,135 @@ const PrintStyle7 = ({ {GlobaldummyData ? GlobalSlNo && ( - - {index + 1} - - ) + + {index + 1} + + ) : SLNO == true && ( - - {index + 1} - - )} + + {index + 1} + + )} {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item == true && ( - -
    {item?.ProdName}
    - {PackageDetails?.filter( - (pkg) => pkg.ProdId === item.ProdId - ).length > 0 ? ( -
    - {PackageDetails?.filter( - (pkg) => pkg.ProdId === item.ProdId - )?.map((item, index) => ( - - {item.ParcelCount} PCS{' '} - {item.ParcelQty} PACK ( - {item.ParcelType}) - - ))} -
    - ) : ( -
    - ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) -
    - )} - - )} + +
    {item?.ProdName}
    + {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + ).length > 0 ? ( +
    + {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + )?.map((item, index) => ( + + {item.ParcelCount} PCS{' '} + {item.ParcelQty} PACK ( + {item.ParcelType}) + + ))} +
    + ) : ( +
    + ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) +
    + )} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - - ) + + {item?.HSN} + + ) : HsnCode == true && ( - - {item?.HSN} - - )} + + {item?.HSN} + + )} {GlobaldummyData ? GlobalQuantity && ( - - {item?.SalesQty} - - ) + + {item?.SalesQty} + + ) : Quantity == true && ( - - {item?.SalesQty} - - )} + + {item?.SalesQty} + + )} {GlobaldummyData ? GlobalMRP && ( - - {item?.MRP} - - ) + + {item?.MRP} + + ) : MRP == true && ( - - {item?.SinglePc === 'Y' - ? item?.Rate - : item?.MRP} - - )} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + )} {GlobaldummyData ? GlobalRate && ( - - {item?.Rate} - - ) + + {item?.Rate} + + ) : Rate == true && ( - - {item?.Rate} - - )} + + {item?.Rate} + + )} {GlobaldummyData ? GlobalDiscount && {item.discount} : Discount == true && ( - - {item?.Type != 'C' - ? item?.OfferAmt || 0 - : item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} {GlobaldummyData ? GlobalTax && ( - - {item?.ProdTaxPercentage} - - ) + + {item?.ProdTaxPercentage} + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - {item?.ProdTaxPercentage || 0} - - )} + table2Data?.OrderType !== 'E' && ( + + {item?.ProdTaxPercentage || 0} + + )} {GlobaldummyData ? GlobalAmount && ( - - {item?.TotalAmt} - - ) + + {item?.TotalAmt} + + ) : Amount == true && ( - - {item?.Type != 'C' - ? item?.TotalAmt - item?.OfferAmt || 0 - : item?.TotalAmt - item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} + + )} ) )} @@ -3236,65 +3237,65 @@ const PrintStyle7 = ({ {GlobaldummyData ? GlobalSlNo && S : SLNO == true && ( - S - )} + S + )} {GlobaldummyData ? GlobalItem && Item : Item == true && Item} {GlobaldummyData ? GlobalHsnCode && ( - HSN - ) + HSN + ) : HsnCode == true && ( - HSN - )} + HSN + )} {GlobaldummyData ? GlobalQuantity && ( - Qty - ) + Qty + ) : Quantity == true && ( - - {WeightasKg ? 'Qty/Kg' : 'Qty'} - - )} + + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + )} {GlobaldummyData ? GlobalMRP && MRP : MRP == true && ( - MRP - )} + MRP + )} {GlobaldummyData ? GlobalRate && ( - Rate - ) + Rate + ) : Rate == true && ( - Rate - )} + Rate + )} {GlobaldummyData ? GlobalDiscount && ( - Dis - ) + Dis + ) : Discount == true && ( - Dis - )} + Dis + )} {GlobaldummyData ? GlobalTax && ( - Tax % - ) + Tax % + ) : Tax && - table2Data?.OrderType !== 'E' && ( - Tax % - )} + table2Data?.OrderType !== 'E' && ( + Tax % + )} {GlobaldummyData ? GlobalAmount && ( - - Amt - - ) + + Amt + + ) : Amount == true && ( - - Amt - - )} + + Amt + + )} @@ -3303,148 +3304,148 @@ const PrintStyle7 = ({ {GlobaldummyData ? GlobalSlNo && ( - - {index + 1} - - ) + + {index + 1} + + ) : SLNO == true && ( - - {index + 1} - - )} + + {index + 1} + + )} {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item == true && ( - -
    {item?.ProdName}
    -
    - ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) - {item?.BrandName !== null - ? item?.BrandName - : ''} -   - {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls?.filter( - (items) => - !( - items.SerialNumber == '' || - items.SerialNumber == null - ) - )?.map((a) => { - return
    {a.SerialNumber}
    ; - }) - : ''}{' '} - {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (item1) => - item1.IMEI1 !== '' || - item1.IMEI2 !== '' - )?.map((item2) => { - const imei1 = item2.IMEI1 || ''; - const imei2 = item2.IMEI2 || ''; - return ( -
    - {[imei1, imei2] - .filter(Boolean) - .join(',')} -
    - ); - }) - : ''} -
    - - )} + +
    {item?.ProdName}
    +
    + ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) + {item?.BrandName !== null + ? item?.BrandName + : ''} +   + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls?.filter( + (items) => + !( + items.SerialNumber == '' || + items.SerialNumber == null + ) + )?.map((a) => { + return
    {a.SerialNumber}
    ; + }) + : ''}{' '} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
    + {[imei1, imei2] + .filter(Boolean) + .join(',')} +
    + ); + }) + : ''} +
    + + )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - - ) + + {item?.HSN} + + ) : HsnCode == true && ( - - {item?.HSN} - - )} + + {item?.HSN} + + )} {GlobaldummyData ? GlobalQuantity && ( - - {item?.SalesQty} - - ) + + {item?.SalesQty} + + ) : Quantity == true && ( - - {item?.SalesQty} - - )} + + {item?.SalesQty} + + )} {GlobaldummyData ? GlobalMRP && ( - - {item?.MRP} - - ) + + {item?.MRP} + + ) : MRP == true && ( - - {item?.SinglePc === 'Y' - ? item?.Rate - : item?.MRP} - - )} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + )} {GlobaldummyData ? GlobalRate && ( - - {item?.Rate} - - ) + + {item?.Rate} + + ) : Rate == true && ( - - {item?.Rate} - - )} + + {item?.Rate} + + )} {GlobaldummyData ? GlobalDiscount && {item.discount} : Discount == true && ( - - {item?.Type != 'C' - ? item?.OfferAmt || 0 - : item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} {GlobaldummyData ? GlobalTax && ( - - {item?.ProdTaxPercentage} - - ) + + {item?.ProdTaxPercentage} + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - {item?.ProdTaxPercentage || 0} - - )} + table2Data?.OrderType !== 'E' && ( + + {item?.ProdTaxPercentage || 0} + + )} {GlobaldummyData ? GlobalAmount && ( - - {item?.TotalAmt} - - ) + + {item?.TotalAmt} + + ) : Amount == true && ( - - {item?.Type != 'C' - ? item?.TotalAmt - item?.OfferAmt || 0 - : item?.TotalAmt - item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} + + )} ) )} @@ -3469,8 +3470,8 @@ const PrintStyle7 = ({ {GlobaldummyData ? '10' : Number( - TotalOfferAmount + table2Data?.OverallDisc - ).toFixed(2)} + TotalOfferAmount + table2Data?.OverallDisc + ).toFixed(2)}
    )} @@ -3915,62 +3916,62 @@ const PrintStyle7 = ({ {GlobaldummyData ? GlobalCredit && ( -
    -
    Advance Amount:
    -
    Opening Balance:
    -
    - ) +
    +
    Advance Amount:
    +
    Opening Balance:
    +
    + ) : CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
    - {/* OLD CREDIT BAL */} - {PaymentStatusSuccess?.[0]?.PaymentTypeName === 'Credit' && ( - <> - {table2Data.CustomerDetails[0].OldCreditBal > 0 ? ( -

    - Advance Amount: - {table2Data.CustomerDetails[0].OldCreditBal} -

    - ) : table2Data.CustomerDetails[0].OldCreditBal < 0 ? ( -

    - {' '} - Opening Balance:{' '} - {Math.abs(table2Data.CustomerDetails[0].OldCreditBal)} -

    - ) : null} - - )} + table2Data?.CustomerDetails?.length > 0 && ( +
    + {/* OLD CREDIT BAL */} + {PaymentStatusSuccess?.[0]?.PaymentTypeName === 'Credit' && ( + <> + {table2Data.CustomerDetails[0].OldCreditBal > 0 ? ( +

    + Advance Amount: + {table2Data.CustomerDetails[0].OldCreditBal} +

    + ) : table2Data.CustomerDetails[0].OldCreditBal < 0 ? ( +

    + {' '} + Opening Balance:{' '} + {Math.abs(table2Data.CustomerDetails[0].OldCreditBal)} +

    + ) : null} + + )} - {/* CURRENT CREDIT BAL */} - {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( -

    - {' '} - Current Advance Amount:{' '} - {table2Data.CustomerDetails[0].CurrentCreditBal} -

    - ) : table2Data.CustomerDetails[0].CurrentCreditBal < 0 ? ( -

    - {' '} - Current Balance Amount:{' '} - {Math.abs(table2Data.CustomerDetails[0].CurrentCreditBal)} -

    - ) : null} -
    - )} + {/* CURRENT CREDIT BAL */} + {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( +

    + {' '} + Current Advance Amount:{' '} + {table2Data.CustomerDetails[0].CurrentCreditBal} +

    + ) : table2Data.CustomerDetails[0].CurrentCreditBal < 0 ? ( +

    + {' '} + Current Balance Amount:{' '} + {Math.abs(table2Data.CustomerDetails[0].CurrentCreditBal)} +

    + ) : null} +
    + )} {GlobaldummyData && GlobalCashierName && (
    {GlobaldummyData ? GlobalQrcodet && ( -
    - QRcode -
    Scan to Pay
    -
    - ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
    +
    + QRcode +
    Scan to Pay
    +
    + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)}
    - ) +
    + ) : Qrcodet && - paymentTypeUPI && ( -
    - -
    Scan to Pay
    -
    - ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
    + paymentTypeUPI && ( +
    + +
    Scan to Pay
    +
    + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)}
    - )} +
    + )}
    )} @@ -4121,21 +4122,21 @@ const PrintStyle7 = ({
    {GlobaldummyData ? GlobalIsnotes && ( -
    -

    - Notes : 10 days Return policy -

    +
    +

    + Notes : 10 days Return policy +

    -
    -
    - ) +
    +
    + ) : Notestext && ( -
    -

    {Notestext}

    +
    +

    {Notestext}

    -
    -
    - )} +
    +
    + )}
    )} @@ -4155,136 +4156,136 @@ const PrintStyle7 = ({ > {GlobaldummyData ? GlobaltermsAndConditions && ( -
    +

    -

    - Terms & Conditions -

    -
      -
    1. - Once goods are sold, they are not exchangeable or - refundable. -
    2. -
    3. - Please check the product before leaving the counter. -
    4. -
    -
    - ) + Terms & Conditions +

    +
      +
    1. + Once goods are sold, they are not exchangeable or + refundable. +
    2. +
    3. + Please check the product before leaving the counter. +
    4. +
    +
    + ) : TermsnAdCondition == true && - TermsAndConditions?.length > 0 && ( -
    0 && ( +
    +

    -

    - Terms & Conditions -

    -
      - {TermsAndConditions?.map((item) => ( -
    1. - {item?.TermsandConditions} -
    2. - ))} - {/*
    3. Please check the product before leaving the counter.
    4. */} -
    -
    - )} + Terms & Conditions +

    +
      + {TermsAndConditions?.map((item) => ( +
    1. + {item?.TermsandConditions} +
    2. + ))} + {/*
    3. Please check the product before leaving the counter.
    4. */} +
    +
    + )} {GlobaldummyData ? GlobalSignature && ( -
    +

    -

    - Signature -

    - -
    - ) + Signature +

    + +
    + ) : Signature == true && ( -
    +

    -

    - Signature -

    - -
    - )} + Signature +

    + +
    + )} )}