Merge pull request 'fixed bugs' (#181) from issue-fix/temp into main

Reviewed-on: Pozomind/pozo-retail-app#181
This commit is contained in:
karthikalakshmi 2026-02-25 19:28:04 +05:30
commit bc8dafa167
25 changed files with 6935 additions and 6813 deletions

View File

@ -11,6 +11,7 @@ import '../../Styles/Product/Product.scss';
import { Messages } from '../Notifications/Messages.jsx'; import { Messages } from '../Notifications/Messages.jsx';
import { isMobile } from 'react-device-detect'; import { isMobile } from 'react-device-detect';
import Camera from '../MobileComponent/Camera.jsx'; import Camera from '../MobileComponent/Camera.jsx';
import useHasCamera from '../../utils/useHasCamera.js';
const allowedTypes = [ const allowedTypes = [
'image/jpeg', 'image/jpeg',
'image/png', 'image/png',
@ -27,6 +28,7 @@ const CropUpload = ({
handleClose = () => { } handleClose = () => { }
}) => { }) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const hasCamera = useHasCamera();
const [messageType, setMessageType] = useState(null); const [messageType, setMessageType] = useState(null);
const [messageData, setMessageData] = useState(null); const [messageData, setMessageData] = useState(null);
const [fileList, setFileList] = useState([]); const [fileList, setFileList] = useState([]);
@ -407,7 +409,7 @@ const CropUpload = ({
<Modal visible={previewVisible} onCancel={handleCancel} footer={null}> <Modal visible={previewVisible} onCancel={handleCancel} footer={null}>
<img alt="Preview" style={{ width: '100%' }} src={previewImage} /> <img alt="Preview" style={{ width: '100%' }} src={previewImage} />
</Modal> </Modal>
{isMobile && fileList?.length == 0 && <> {isMobile && fileList?.length == 0 && hasCamera && <>
<div style={{ textAlign: "center", margin: "6px 0", fontFamily: "Poppins", fontWeight: "500" }}>OR</div> <div style={{ textAlign: "center", margin: "6px 0", fontFamily: "Poppins", fontWeight: "500" }}>OR</div>
<Camera <Camera
handleCapture={async (e) => { handleCapture={async (e) => {

View File

@ -5,6 +5,8 @@ import { PlusOutlined } from '@ant-design/icons';
import { uploadImage } from '../../Features/upload/upload'; import { uploadImage } from '../../Features/upload/upload';
import Camera from '../MobileComponent/Camera'; import Camera from '../MobileComponent/Camera';
import { isMobile } from 'react-device-detect'; import { isMobile } from 'react-device-detect';
import useHasCamera from '../../utils/useHasCamera';
const allowedTypes = [ const allowedTypes = [
'image/jpeg', 'image/jpeg',
'image/png', 'image/png',
@ -27,6 +29,7 @@ const App = ({ singleImage, updateImageUrl, ImageLink = '', listType }) => {
const [previewImage, setPreviewImage] = useState(''); const [previewImage, setPreviewImage] = useState('');
const [previewTitle, setPreviewTitle] = useState(''); const [previewTitle, setPreviewTitle] = useState('');
const [fileList, setFileList] = useState([]); const [fileList, setFileList] = useState([]);
const hasCamera = useHasCamera();
console.log(fileList, "fileList") console.log(fileList, "fileList")
useEffect(() => { useEffect(() => {
@ -141,7 +144,7 @@ const App = ({ singleImage, updateImageUrl, ImageLink = '', listType }) => {
src={previewImage} src={previewImage}
/> />
</Modal> </Modal>
{isMobile && fileList?.length == 0 && <> {isMobile && fileList?.length == 0 && hasCamera && <>
<div style={{ textAlign: "center", margin: "6px 0", fontFamily: "Poppins", fontWeight: "500" }}>OR</div> <div style={{ textAlign: "center", margin: "6px 0", fontFamily: "Poppins", fontWeight: "500" }}>OR</div>
<Camera <Camera
handleCapture={(e) => { handleCapture={(e) => {

View File

@ -268,8 +268,6 @@ const ComboEditQtyAndRate = (props) => {
} }
const AddProductQuantity = async () => { const AddProductQuantity = async () => {
// debugger
let newPrice = editedPrice > 0 ? editedPrice : props.Productdata.OrderRate; let newPrice = editedPrice > 0 ? editedPrice : props.Productdata.OrderRate;
await dispatch(changeHoldOrderDtl(false)); await dispatch(changeHoldOrderDtl(false));

View File

@ -99,6 +99,11 @@ const InvoiceTemplate = ({
(setting) => (setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' setting?.SettingIdName?.toLowerCase() === 'estimateprintheader'
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const keysLength = Object.keys(table2Data ?? {}).length; const keysLength = Object.keys(table2Data ?? {}).length;
console.log(GlobalDiscount, Discount, 'Discount'); console.log(GlobalDiscount, Discount, 'Discount');
@ -944,7 +949,7 @@ const InvoiceTemplate = ({
{/* Invoice Title */} {/* Invoice Title */}
<div className="invoice-title"> <div className="invoice-title">
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
fontSize: '14px', fontSize: '14px',
@ -2744,7 +2749,7 @@ const InvoiceTemplate = ({
{/* Invoice Title */} {/* Invoice Title */}
<div className="invoice-title"> <div className="invoice-title">
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
fontSize: '14px', fontSize: '14px',

View File

@ -106,6 +106,11 @@ const PrintA4Style11 = ({
(setting) => (setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' setting?.SettingIdName?.toLowerCase() === 'estimateprintheader'
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const currentDate = new Date(); const currentDate = new Date();
console.log(OrderDetailGST, 'OrderDetailGST'); console.log(OrderDetailGST, 'OrderDetailGST');
const day = currentDate.getDate().toString().padStart(2, '0'); const day = currentDate.getDate().toString().padStart(2, '0');
@ -394,7 +399,7 @@ const PrintA4Style11 = ({
</div> </div>
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
textTransform: 'uppercase', textTransform: 'uppercase',

View File

@ -106,6 +106,11 @@ const PrintA5Style11 = ({
(setting) => (setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' setting?.SettingIdName?.toLowerCase() === 'estimateprintheader'
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const currentDate = new Date(); const currentDate = new Date();
console.log(FieldDetails, 'FieldDetails'); console.log(FieldDetails, 'FieldDetails');
const day = currentDate.getDate().toString().padStart(2, '0'); const day = currentDate.getDate().toString().padStart(2, '0');

View File

@ -30,6 +30,11 @@ const TaxInvoice = ({
(setting) => (setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' setting?.SettingIdName?.toLowerCase() === 'estimateprintheader'
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
let BillName = printDatas?.PrintHdrName; let BillName = printDatas?.PrintHdrName;
let companyColour = printDatas?.PrintHdrColor ?? '#00000'; let companyColour = printDatas?.PrintHdrColor ?? '#00000';
@ -374,7 +379,7 @@ const TaxInvoice = ({
> >
<div></div> <div></div>
<h2 style={{ margin: '0', fontSize: '20px', fontWeight: '700' }}> <h2 style={{ margin: '0', fontSize: '20px', fontWeight: '700' }}>
{table2Data?.OrderType === 'E' {table2Data?.OrderType === 'E' && estimateTitle
? 'Estimate' ? 'Estimate'
: BillName : BillName
? BillName ? BillName

View File

@ -123,6 +123,12 @@ const PrintStyle1 = ({
setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' setting?.SettingIdName?.toLowerCase() === 'estimateprintheader'
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const keysLength = Object.keys(table2Data ?? {}).length; const keysLength = Object.keys(table2Data ?? {}).length;
const paymentTypeUPI = PaymentStatus?.find( const paymentTypeUPI = PaymentStatus?.find(
(ps) => ps.PaymentTypeName === 'UPI' (ps) => ps.PaymentTypeName === 'UPI'
@ -479,7 +485,7 @@ const PrintStyle1 = ({
Mobile : +91{' '} Mobile : +91{' '}
{GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile} {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
</div>} </div>}
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
fontSize: '14px', fontSize: '14px',
@ -521,7 +527,7 @@ const PrintStyle1 = ({
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
fontSize: '14px', fontSize: '14px',
@ -3727,7 +3733,7 @@ const PrintStyle1 = ({
Mobile : +91{' '} Mobile : +91{' '}
{GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile} {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
</div>} </div>}
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
fontSize: '14px', fontSize: '14px',
@ -3768,7 +3774,7 @@ const PrintStyle1 = ({
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
fontSize: '14px', fontSize: '14px',

View File

@ -106,6 +106,11 @@ const PrintStyle10 = ({
(setting) => (setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' setting?.SettingIdName?.toLowerCase() === 'estimateprintheader'
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const bookingTypePreference = appPreferences?.find( const bookingTypePreference = appPreferences?.find(
(preference) => preference?.PreferredCatName === 'Booking Type' (preference) => preference?.PreferredCatName === 'Booking Type'
)?.PreferenceCatDetails; )?.PreferenceCatDetails;
@ -453,7 +458,7 @@ const PrintStyle10 = ({
? '8428XXXXXX' ? '8428XXXXXX'
: table2Data?.BrMobile} : table2Data?.BrMobile}
</p> </p>
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div style={{ textTransform: 'uppercase' }}> <div style={{ textTransform: 'uppercase' }}>
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {SalesModePref?.SettingValue == 'Y' &&
@ -481,7 +486,7 @@ const PrintStyle10 = ({
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ textTransform: 'uppercase', textAlign: 'center' }} style={{ textTransform: 'uppercase', textAlign: 'center' }}
> >
@ -3113,7 +3118,7 @@ const PrintStyle10 = ({
Mobile:+91{' '} Mobile:+91{' '}
{GlobaldummyData ? '8428XXXXXX' : table2Data?.BrMobile} {GlobaldummyData ? '8428XXXXXX' : table2Data?.BrMobile}
</p> </p>
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div style={{ textTransform: 'uppercase' }}> <div style={{ textTransform: 'uppercase' }}>
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {SalesModePref?.SettingValue == 'Y' &&
@ -3140,7 +3145,7 @@ const PrintStyle10 = ({
</div> </div>
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div style={{ textTransform: 'uppercase' }}> <div style={{ textTransform: 'uppercase' }}>
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {SalesModePref?.SettingValue == 'Y' &&

View File

@ -110,6 +110,11 @@ const PrintStyle11 = ({
(setting) => (setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' setting?.SettingIdName?.toLowerCase() === 'estimateprintheader'
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const bookingTypePreference = appPreferences?.find( const bookingTypePreference = appPreferences?.find(
(preference) => preference?.PreferredCatName === 'Booking Type' (preference) => preference?.PreferredCatName === 'Booking Type'
)?.PreferenceCatDetails; )?.PreferenceCatDetails;
@ -481,7 +486,7 @@ const PrintStyle11 = ({
</div> </div>
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ textTransform: 'uppercase', textAlign: 'center' }} style={{ textTransform: 'uppercase', textAlign: 'center' }}
> >
@ -3132,7 +3137,7 @@ const PrintStyle11 = ({
</div> </div>
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div style={{ textTransform: 'uppercase', textAlign: 'center' }}> <div style={{ textTransform: 'uppercase', textAlign: 'center' }}>
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {SalesModePref?.SettingValue == 'Y' &&

View File

@ -109,6 +109,11 @@ const Printstyle12 = ({
(setting) => (setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' setting?.SettingIdName?.toLowerCase() === 'estimateprintheader'
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const bookingTypePreference = appPreferences?.find( const bookingTypePreference = appPreferences?.find(
(preference) => preference?.PreferredCatName === 'Booking Type' (preference) => preference?.PreferredCatName === 'Booking Type'
)?.PreferenceCatDetails; )?.PreferenceCatDetails;
@ -632,7 +637,7 @@ const Printstyle12 = ({
{table2Data?.SalesTableLinkDetails?.[0]?.WaiterName} {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName}
</div> </div>
)} )}
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
fontSize: 'clamp(0.75rem, 2.5vw, 1rem)', fontSize: 'clamp(0.75rem, 2.5vw, 1rem)',
@ -668,7 +673,7 @@ const Printstyle12 = ({
) : null} ) : null}
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
fontSize: 'clamp(0.75rem, 2.5vw, 1rem)', fontSize: 'clamp(0.75rem, 2.5vw, 1rem)',
@ -3284,7 +3289,7 @@ const Printstyle12 = ({
{table2Data?.SalesTableLinkDetails?.[0]?.WaiterName} {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName}
</div> </div>
)} )}
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
fontSize: 'clamp(0.75rem, 2.5vw, 1rem)', fontSize: 'clamp(0.75rem, 2.5vw, 1rem)',
@ -3317,7 +3322,7 @@ const Printstyle12 = ({
) : null} ) : null}
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
fontSize: 'clamp(0.75rem, 2.5vw, 1rem)', fontSize: 'clamp(0.75rem, 2.5vw, 1rem)',

View File

@ -112,6 +112,11 @@ const Printstyle2 = ({
(setting) => (setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' setting?.SettingIdName?.toLowerCase() === 'estimateprintheader'
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const bookingTypePreference = appPreferences?.find( const bookingTypePreference = appPreferences?.find(
(preference) => preference?.PreferredCatName === 'Booking Type' (preference) => preference?.PreferredCatName === 'Booking Type'
)?.PreferenceCatDetails; )?.PreferenceCatDetails;
@ -450,7 +455,7 @@ const Printstyle2 = ({
</div> </div>
)} )}
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
fontWeight: '600', fontWeight: '600',
@ -3076,7 +3081,7 @@ const Printstyle2 = ({
</div> </div>
)} )}
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
fontWeight: '600', fontWeight: '600',

View File

@ -80,7 +80,12 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
const GlobalLogo = useSelector(GlobalprintLogo); const GlobalLogo = useSelector(GlobalprintLogo);
const GlobalCredit = useSelector(GlobalprintCredit); const GlobalCredit = useSelector(GlobalprintCredit);
const SettingData = useSelector(PreferenceData); const SettingData = useSelector(PreferenceData);
const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find(setting => setting?.SettingIdName?.toLowerCase() === 'estimateprintheader')?.SettingValue === 'Y' const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find(setting => setting?.SettingIdName?.toLowerCase() === 'estimateprintheader')?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const bookingTypePreference = appPreferences?.find((preference) => preference?.PreferredCatName === 'Booking Type')?.PreferenceCatDetails const bookingTypePreference = appPreferences?.find((preference) => preference?.PreferredCatName === 'Booking Type')?.PreferenceCatDetails
const dinePreference = bookingTypePreference?.find((type) => type?.PreferredSubCatName?.toLowerCase() === "dine in" && type?.PreferredStatus === 'Y') const dinePreference = bookingTypePreference?.find((type) => type?.PreferredSubCatName?.toLowerCase() === "dine in" && type?.PreferredStatus === 'Y')
const takeAwayPreference = bookingTypePreference?.find((type) => type?.PreferredSubCatName?.toLowerCase() === "take away" && type?.PreferredStatus === 'Y') const takeAwayPreference = bookingTypePreference?.find((type) => type?.PreferredSubCatName?.toLowerCase() === "take away" && type?.PreferredStatus === 'Y')
@ -223,13 +228,13 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
{table2Data?.BrGSTIN && <div>GST NO :{GlobaldummyData ? '334bhbsagbysfgbfgbu' : table2Data?.BrGSTIN},</div>} {table2Data?.BrGSTIN && <div>GST NO :{GlobaldummyData ? '334bhbsagbysfgbfgbu' : table2Data?.BrGSTIN},</div>}
<div style={{ fontWeight: '600' }}> Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}</div> <div style={{ fontWeight: '600' }}> Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}</div>
{table2Data?.OrderType === "E" && <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>Estimate Bill {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}</div>} {table2Data?.OrderType === "E" && estimateTitle && <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>Estimate Bill {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}</div>}
{table2Data?.OrderType === "E" ? "" : <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>{GlobaldummyData ? 'Cash Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""} {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} </div>} {table2Data?.OrderType === "E" ? "" : <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>{GlobaldummyData ? 'Cash Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""} {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} </div>}
</div> </div>
</div>)} </div>)}
{(!estimatePrintHeader && table2Data?.OrderType === "E") && <div style={{ fontSize: "14px", margin: "2px 0 0 0", textAlign: 'center', padding: 0, fontWeight: 600 }}>Estimate Bill {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}</div>} {(!estimatePrintHeader && table2Data?.OrderType === "E" && estimateTitle) && <div style={{ fontSize: "14px", margin: "2px 0 0 0", textAlign: 'center', padding: 0, fontWeight: 600 }}>Estimate Bill {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}</div>}
<hr className="PrintStyle3-print-dottline" /> <hr className="PrintStyle3-print-dottline" />
<div className="PrintStyle3-print-ordr-dtls"> <div className="PrintStyle3-print-ordr-dtls">
@ -1150,12 +1155,12 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
{table2Data?.BrGSTIN && <div>GST NO :{GlobaldummyData ? '334bhbsagbysfgbfgbu' : table2Data?.BrGSTIN},</div>} {table2Data?.BrGSTIN && <div>GST NO :{GlobaldummyData ? '334bhbsagbysfgbfgbu' : table2Data?.BrGSTIN},</div>}
<div style={{ fontWeight: '600' }}> Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}</div> <div style={{ fontWeight: '600' }}> Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}</div>
{table2Data?.OrderType === "E" && <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>Estimate Bill {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}</div>} {table2Data?.OrderType === "E" && estimateTitle && <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>Estimate Bill {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}</div>}
{table2Data?.OrderType === "E" ? "" : <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>{GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Cash" + ' Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ""} {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}</div>} {table2Data?.OrderType === "E" ? "" : <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>{GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Cash" + ' Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ""} {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}</div>}
</div> </div>
</div>)} </div>)}
{(!estimatePrintHeader && table2Data?.OrderType === "E") && <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>Estimate Bill {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}</div>} {(!estimatePrintHeader && table2Data?.OrderType === "E" && estimateTitle) && <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>Estimate Bill {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}</div>}
<hr className="PrintStyle3-print-dottline" /> <hr className="PrintStyle3-print-dottline" />
<div className="PrintStyle3-print-ordr-dtls"> <div className="PrintStyle3-print-ordr-dtls">
<div style={{ lineheight: '50px' }}> <div style={{ lineheight: '50px' }}>

View File

@ -119,6 +119,11 @@ const Printstyle4 = ({
(setting) => (setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' setting?.SettingIdName?.toLowerCase() === 'estimateprintheader'
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const bookingTypePreference = appPreferences?.find( const bookingTypePreference = appPreferences?.find(
(preference) => preference?.PreferredCatName === 'Booking Type' (preference) => preference?.PreferredCatName === 'Booking Type'
)?.PreferenceCatDetails; )?.PreferenceCatDetails;
@ -495,7 +500,7 @@ const Printstyle4 = ({
{/* <div>{GlobaldummyData ? formattedDate : Date1}</div> */} {/* <div>{GlobaldummyData ? formattedDate : Date1}</div> */}
</div> </div>
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
className="PrintStyle4-FourthSpan" className="PrintStyle4-FourthSpan"
style={{ textTransform: 'uppercase', fontSize: '12px' }} style={{ textTransform: 'uppercase', fontSize: '12px' }}
@ -3196,7 +3201,7 @@ const Printstyle4 = ({
</div> </div>
</div> </div>
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
className="PrintStyle4-FourthSpan" className="PrintStyle4-FourthSpan"
style={{ textTransform: 'uppercase', fontSize: '12px' }} style={{ textTransform: 'uppercase', fontSize: '12px' }}

View File

@ -108,6 +108,11 @@ const PrintStyle5 = ({
(setting) => (setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' setting?.SettingIdName?.toLowerCase() === 'estimateprintheader'
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const bookingTypePreference = appPreferences?.find( const bookingTypePreference = appPreferences?.find(
(preference) => preference?.PreferredCatName === 'Booking Type' (preference) => preference?.PreferredCatName === 'Booking Type'
)?.PreferenceCatDetails; )?.PreferenceCatDetails;
@ -429,7 +434,7 @@ const PrintStyle5 = ({
? '1234567890' ? '1234567890'
: table2Data?.BrMobile}{' '} : table2Data?.BrMobile}{' '}
</div> </div>
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div style={{ textTransform: 'uppercase' }}> <div style={{ textTransform: 'uppercase' }}>
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {SalesModePref?.SettingValue == 'Y' &&
@ -455,7 +460,7 @@ const PrintStyle5 = ({
<hr /> <hr />
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ textTransform: 'uppercase', textAlign: 'center' }} style={{ textTransform: 'uppercase', textAlign: 'center' }}
> >
@ -2721,7 +2726,7 @@ const PrintStyle5 = ({
Mobile : Mobile :
{GlobaldummyData ? '1234567890' : table2Data?.BrMobile}{' '} {GlobaldummyData ? '1234567890' : table2Data?.BrMobile}{' '}
</div> </div>
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div style={{ textTransform: 'uppercase' }}> <div style={{ textTransform: 'uppercase' }}>
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {SalesModePref?.SettingValue == 'Y' &&
@ -2749,7 +2754,7 @@ const PrintStyle5 = ({
<hr /> <hr />
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div style={{ textTransform: 'uppercase', textAlign: 'center' }}> <div style={{ textTransform: 'uppercase', textAlign: 'center' }}>
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {SalesModePref?.SettingValue == 'Y' &&

View File

@ -110,6 +110,11 @@ const Printstyle6 = ({
(setting) => (setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' setting?.SettingIdName?.toLowerCase() === 'estimateprintheader'
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const bookingTypePreference = appPreferences?.find( const bookingTypePreference = appPreferences?.find(
(preference) => preference?.PreferredCatName === 'Booking Type' (preference) => preference?.PreferredCatName === 'Booking Type'
)?.PreferenceCatDetails; )?.PreferenceCatDetails;
@ -441,7 +446,7 @@ const Printstyle6 = ({
Mobile : {table2Data?.BrMobile} Mobile : {table2Data?.BrMobile}
</div>} </div>}
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
textTransform: 'uppercase', textTransform: 'uppercase',
@ -478,7 +483,7 @@ const Printstyle6 = ({
)} )}
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
textTransform: 'uppercase', textTransform: 'uppercase',
@ -3297,7 +3302,7 @@ const Printstyle6 = ({
Mobile : {table2Data?.BrMobile} Mobile : {table2Data?.BrMobile}
</div>} </div>}
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
textTransform: 'uppercase', textTransform: 'uppercase',
@ -3337,7 +3342,7 @@ const Printstyle6 = ({
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
textTransform: 'uppercase', textTransform: 'uppercase',

View File

@ -105,6 +105,11 @@ const PrintStyle7 = ({
(setting) => (setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' setting?.SettingIdName?.toLowerCase() === 'estimateprintheader'
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const bookingTypePreference = appPreferences?.find( const bookingTypePreference = appPreferences?.find(
(preference) => preference?.PreferredCatName === 'Booking Type' (preference) => preference?.PreferredCatName === 'Booking Type'
)?.PreferenceCatDetails; )?.PreferenceCatDetails;
@ -453,7 +458,7 @@ const PrintStyle7 = ({
: '') + table2Data?.AddressDetails?.[0]?.Zip : '') + table2Data?.AddressDetails?.[0]?.Zip
: '')} : '')}
</div> </div>
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
fontSize: '12px', fontSize: '12px',
@ -490,7 +495,7 @@ const PrintStyle7 = ({
)} )}
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
fontSize: '12px', fontSize: '12px',
@ -2908,7 +2913,7 @@ const PrintStyle7 = ({
: '') + table2Data?.AddressDetails?.[0]?.Zip : '') + table2Data?.AddressDetails?.[0]?.Zip
: '')} : '')}
</div> </div>
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
fontSize: '12px', fontSize: '12px',
@ -2947,7 +2952,7 @@ const PrintStyle7 = ({
)} )}
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
style={{ style={{
fontSize: '12px', fontSize: '12px',

View File

@ -110,6 +110,11 @@ const Printstyle8 = ({
(setting) => (setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' setting?.SettingIdName?.toLowerCase() === 'estimateprintheader'
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const bookingTypePreference = appPreferences?.find( const bookingTypePreference = appPreferences?.find(
(preference) => preference?.PreferredCatName === 'Booking Type' (preference) => preference?.PreferredCatName === 'Booking Type'
)?.PreferenceCatDetails; )?.PreferenceCatDetails;
@ -473,7 +478,7 @@ const Printstyle8 = ({
</div> </div>
</div> </div>
)} )}
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
className="PrintStyle4-FourthSpan" className="PrintStyle4-FourthSpan"
style={{ textTransform: 'uppercase', fontWeight: '600' }} style={{ textTransform: 'uppercase', fontWeight: '600' }}
@ -3276,7 +3281,7 @@ const Printstyle8 = ({
</div> </div>
</div> </div>
)} )}
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
className="PrintStyle4-FourthSpan" className="PrintStyle4-FourthSpan"
style={{ textTransform: 'uppercase', fontWeight: '600' }} style={{ textTransform: 'uppercase', fontWeight: '600' }}

View File

@ -107,6 +107,11 @@ const PrintStyle9 = ({
(setting) => (setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' setting?.SettingIdName?.toLowerCase() === 'estimateprintheader'
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const bookingTypePreference = appPreferences?.find( const bookingTypePreference = appPreferences?.find(
(preference) => preference?.PreferredCatName === 'Booking Type' (preference) => preference?.PreferredCatName === 'Booking Type'
)?.PreferenceCatDetails; )?.PreferenceCatDetails;
@ -470,7 +475,7 @@ const PrintStyle9 = ({
Mobile : +91{' '} Mobile : +91{' '}
{GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile} {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
</div> </div>
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
className="" className=""
style={{ style={{
@ -527,7 +532,7 @@ const PrintStyle9 = ({
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
className="" className=""
style={{ style={{
@ -3211,7 +3216,7 @@ const PrintStyle9 = ({
Mobile : +91{' '} Mobile : +91{' '}
{GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile} {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
</div> </div>
{table2Data?.OrderType === 'E' && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
className="" className=""
style={{ style={{
@ -3276,7 +3281,7 @@ const PrintStyle9 = ({
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div <div
className="" className=""
style={{ style={{

View File

@ -33,8 +33,6 @@ import { getCommonAppPreference } from '../../Features/BrachLogin/BranchLogin.js
import { AiOutlineDownCircle, AiOutlineUpCircle } from 'react-icons/ai'; import { AiOutlineDownCircle, AiOutlineUpCircle } from 'react-icons/ai';
// import TextArea from 'antd/es/input/TextArea.js'; // import TextArea from 'antd/es/input/TextArea.js';
import CropUpload from '../../Components/Forms/CropUpload.jsx'; import CropUpload from '../../Components/Forms/CropUpload.jsx';
import { isMobile } from 'react-device-detect';
import Camera from '../../Components/MobileComponent/Camera.jsx';
const { Panel } = Collapse; const { Panel } = Collapse;
const { TextArea } = Input; const { TextArea } = Input;
const subDirectory = import.meta.env.BASE_URL; const subDirectory = import.meta.env.BASE_URL;

View File

@ -102,7 +102,10 @@ const PreferenceList = () => {
(k) => allSettingsMap[k]?.value === 'Y' (k) => allSettingsMap[k]?.value === 'Y'
), ),
mobilea4: allSettingsMap['mobilea4']?.value === 'Y', mobilea4: allSettingsMap['mobilea4']?.value === 'Y',
estimateprintheader: allSettingsMap['estimateprintheader']?.value === 'Y', estimateSettings: [
...(allSettingsMap['estimateprintheader']?.value === 'Y' ? ['estimateprintheader'] : []),
...(allSettingsMap['estimatetitle']?.value === 'Y' ? ['estimatetitle'] : []),
],
scanlayout: allSettingsMap['scanlayout']?.value === 'Y', scanlayout: allSettingsMap['scanlayout']?.value === 'Y',
verifyproduct: allSettingsMap['verifyproduct']?.value === 'Y', verifyproduct: allSettingsMap['verifyproduct']?.value === 'Y',
customisedbillnumber: allSettingsMap['customisedbillnumber']?.value === 'Y', customisedbillnumber: allSettingsMap['customisedbillnumber']?.value === 'Y',
@ -304,7 +307,6 @@ const PreferenceList = () => {
tokenonly: values.tokenonly, tokenonly: values.tokenonly,
allproductindividualtoken: values.allproductindividualtoken, allproductindividualtoken: values.allproductindividualtoken,
mobilea4: values.mobilea4, mobilea4: values.mobilea4,
estimateprintheader: values.estimateprintheader,
scanlayout: values.scanlayout, scanlayout: values.scanlayout,
verifyproduct: values.verifyproduct, verifyproduct: values.verifyproduct,
customisedbillnumber: values.customisedbillnumber, customisedbillnumber: values.customisedbillnumber,
@ -321,6 +323,8 @@ const PreferenceList = () => {
dinein: values.enabledModules, dinein: values.enabledModules,
estimation: values.enabledModules, estimation: values.enabledModules,
parking: values.enabledFeatures, parking: values.enabledFeatures,
estimateprintheader: values.estimateSettings,
estimatetitle: values.estimateSettings,
offer: values.enabledFeatures, offer: values.enabledFeatures,
whatsapp: values.pdfSendOptions, whatsapp: values.pdfSendOptions,
sms: values.pdfSendOptions, sms: values.pdfSendOptions,
@ -783,9 +787,21 @@ const PreferenceList = () => {
'mobilea4', 'mobilea4',
'Prefer printing in A4/A5 on mobile?' 'Prefer printing in A4/A5 on mobile?'
)} )}
{renderCheckbox( {(allSettingsMap['estimateprintheader'] !== undefined ||
'estimateprintheader', allSettingsMap['estimatetitle'] !== undefined) && (
'Do you want to include a header when printing Estimate bills?' <Form.Item
name="estimateSettings"
label="Estimate Print Settings :"
>
<Checkbox.Group>
{allSettingsMap['estimateprintheader'] !== undefined && (
<Checkbox value="estimateprintheader">Show shop header (Name, Address, GST)</Checkbox>
)}
{allSettingsMap['estimatetitle'] !== undefined && (
<Checkbox value="estimatetitle">Show Estimate (R/W) title</Checkbox>
)}
</Checkbox.Group>
</Form.Item>
)} )}
</div> </div>
<div className="PreferencesBTN"> <div className="PreferencesBTN">

View File

@ -133,6 +133,11 @@ const PaymentPdfBooking = ({
(setting) => (setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' setting?.SettingIdName?.toLowerCase() === 'estimateprintheader'
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const bookingTypePreference = appPreferences?.find( const bookingTypePreference = appPreferences?.find(
(preference) => preference?.PreferredCatName === 'Booking Type' (preference) => preference?.PreferredCatName === 'Booking Type'
)?.PreferenceCatDetails; )?.PreferenceCatDetails;
@ -435,7 +440,7 @@ const PaymentPdfBooking = ({
</div> </div>
)} )}
<div className="Re-print-top"> <div className="Re-print-top">
{table2Data?.OrderType === 'E' ? ( {table2Data?.OrderType === 'E' && estimateTitle ? (
<div <div
style={{ style={{
display: 'flex', display: 'flex',

19
src/utils/useHasCamera.js Normal file
View File

@ -0,0 +1,19 @@
import { useState, useEffect } from "react";
export default function useHasCamera() {
const [hasCamera, setHasCamera] = useState(null);
useEffect(() => {
async function detectCamera() {
try {
const devices = await navigator.mediaDevices.enumerateDevices();
setHasCamera(devices.some(d => d.kind === "videoinput"));
} catch {
setHasCamera(false);
}
}
detectCamera();
}, []);
return hasCamera;
}