jut chnge
This commit is contained in:
parent
c4818c08e7
commit
0fc07aaeac
|
|
@ -1419,6 +1419,49 @@ export const getMissedOrderids = createAsyncThunk(
|
|||
);
|
||||
}
|
||||
);
|
||||
// get /LastBuyProductList
|
||||
export const CustomerOrderList = createAsyncThunk(
|
||||
'CustomerOrderList/LastBuyProductList',
|
||||
async (data) => {
|
||||
const { AppId, CompId, BranchId, MobileNo,FromDate,ToDate } = data;
|
||||
if (
|
||||
AppId != null &&
|
||||
AppId != undefined &&
|
||||
CompId != null &&
|
||||
CompId != undefined &&
|
||||
BranchId != null &&
|
||||
BranchId != undefined &&
|
||||
FromDate != null &&
|
||||
FromDate != undefined &&
|
||||
ToDate != null &&
|
||||
ToDate != undefined &&
|
||||
MobileNo != null &&
|
||||
MobileNo != undefined
|
||||
) {
|
||||
return await axiosRetailInstanceData.get(
|
||||
`/LastBuyProductList?compId=${CompId}&branchId=${BranchId}&appId=${AppId}&mobileNo=${MobileNo}&fromDate=${FromDate}&toDate=${ToDate}`
|
||||
);
|
||||
}
|
||||
else if (
|
||||
AppId != null &&
|
||||
AppId != undefined &&
|
||||
CompId != null &&
|
||||
CompId != undefined &&
|
||||
BranchId != null &&
|
||||
BranchId != undefined &&
|
||||
MobileNo != null &&
|
||||
MobileNo != undefined
|
||||
) {
|
||||
return await axiosRetailInstanceData.get(
|
||||
`/LastBuyProductList?compId=${CompId}&branchId=${BranchId}&appId=${AppId}&mobileNo=${MobileNo}`
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
const initialState = {
|
||||
PrintStyle: null,
|
||||
CustId: null,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import React, { useCallback, useEffect, useState, useRef } from 'react';
|
|||
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import moment from 'moment';
|
||||
import { Badge, Popover, Modal } from 'antd';
|
||||
import { Badge, Popover, Modal, Tooltip } from 'antd';
|
||||
import { Tables } from '../../../../../Components/Tables/Table';
|
||||
import { DefaultModal } from '../../../../../Components/Modal/DefaultModal.jsx';
|
||||
import { UpOutlined } from '@ant-design/icons';
|
||||
|
|
@ -181,7 +181,7 @@ import {
|
|||
import WhatsAppShare from '../../../../WhatsAppShare/whatsAppShare.jsx';
|
||||
import SMSShare from '../../../../WhatsAppShare/SmsShare.jsx';
|
||||
import { MdSms } from 'react-icons/md';
|
||||
import { FaWhatsapp, FaPrint } from 'react-icons/fa';
|
||||
import { FaWhatsapp, FaPrint, FaCartPlus } from 'react-icons/fa';
|
||||
import BSTipAmount from '../../UtillComponents/BSTipAmount.jsx';
|
||||
import { ApplicationPreferences } from '../../../../../Features/BrachLogin/BranchLogin.js';
|
||||
import BSOtherServiceClaim from '../../UtillComponents/BSOtherServiceClaim.jsx';
|
||||
|
|
@ -204,6 +204,7 @@ import PaymentGatewayEmbedded from '../../UtillComponents/PaymentGatewayEmbedded
|
|||
import pozologoimg from '../../../../../Images/pozologoimg.png';
|
||||
import MobileMultiPdfPrintTrigger from '../../UtillComponents/MobileMultiPdfPrintTrigger.jsx';
|
||||
import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/DateStore.js';
|
||||
import CustomerOrders from '../../BookingFunctionality/CustomerOrders.jsx';
|
||||
|
||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
||||
|
|
@ -365,6 +366,7 @@ export default function BST1Payment() {
|
|||
const [CardPayOption, setCardPayOption] = useState([]);
|
||||
const [Splitpayment, setSplitpayment] = useState(false);
|
||||
const [UnpaidConfirmation, setUnpaidConfirmation] = useState(false);
|
||||
const [customerPreviesOrders, setCustomerPreviesOrders] = useState(false);
|
||||
const [unpaidselectedindex, setunpaidselectedindex] = useState();
|
||||
const GlobaluseOptions = useSelector(GlobalCommonPaymentOptions);
|
||||
const [useOptions, setuseOptions] = useState([]);
|
||||
|
|
@ -3674,6 +3676,43 @@ export default function BST1Payment() {
|
|||
</div>
|
||||
)}
|
||||
|
||||
{/* Customer Orders */}
|
||||
{GetCustId && (
|
||||
|
||||
<Tooltip title="Customer Orders" isMobile={isMobile}>
|
||||
{' '}
|
||||
<div
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => {
|
||||
if (
|
||||
CheckBookingStatus !== 'Close' &&
|
||||
!addnewAccess &&
|
||||
!(OrderCardDetail?.length > 0)
|
||||
) {
|
||||
setCustomerPreviesOrders(true);
|
||||
}
|
||||
}}
|
||||
style={{
|
||||
cursor: OrderCardDetail?.length > 0 && 'not-allowed',
|
||||
color:
|
||||
OrderCardDetail?.length > 0 ||
|
||||
(OrderCardDetail?.length > 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
fontSize: '25px',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
height: '2.46rem',
|
||||
width: '1.5rem',
|
||||
}}
|
||||
>
|
||||
<FaCartPlus />
|
||||
</div>
|
||||
</Tooltip>
|
||||
)}
|
||||
|
||||
|
||||
{OtherServicesglobal && OrderCardDetail.length >= 1 && (
|
||||
<TooltipWrapper title="Vehicle Number" isMobile={isMobile}>
|
||||
{' '}
|
||||
|
|
@ -4344,6 +4383,24 @@ export default function BST1Payment() {
|
|||
Do you want to cancel the payment?
|
||||
</Modal>
|
||||
)}
|
||||
|
||||
{customerPreviesOrders && (
|
||||
<DefaultModal
|
||||
open={customerPreviesOrders}
|
||||
handleCancel={() => setCustomerPreviesOrders(false)}
|
||||
footer={false}
|
||||
width={700}
|
||||
className={'ModalPaymentGatewayEmbedded'}
|
||||
children={
|
||||
<>
|
||||
<CustomerOrders
|
||||
CustomerDetails={selOption}
|
||||
close={() => setCustomerPreviesOrders(false)}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import React, { useCallback, useEffect, useState, useRef } from 'react';
|
|||
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import moment from 'moment';
|
||||
import { Badge, Popover, Modal } from 'antd';
|
||||
import { Badge, Popover, Modal, Tooltip } from 'antd';
|
||||
import {
|
||||
ArrowRightOutlined,
|
||||
UpCircleOutlined,
|
||||
|
|
@ -189,7 +189,7 @@ import { getCombolist } from '../../../../../Features/ComboMaster/ComboMaster.js
|
|||
import SMSShare from '../../../../WhatsAppShare/SmsShare.jsx';
|
||||
import WhatsAppShare from '../../../../WhatsAppShare/whatsAppShare.jsx';
|
||||
import { MdSms } from 'react-icons/md';
|
||||
import { FaWhatsapp, FaPrint } from 'react-icons/fa';
|
||||
import { FaWhatsapp, FaPrint, FaCartPlus } from 'react-icons/fa';
|
||||
import BSTipAmount from '../../UtillComponents/BSTipAmount.jsx';
|
||||
import { ApplicationPreferences } from '../../../../../Features/BrachLogin/BranchLogin.js';
|
||||
import { PostOtherServices } from '../../../../../Features/OtherServices/OtherServices.js';
|
||||
|
|
@ -352,6 +352,7 @@ const BSBillingTable2 = () => {
|
|||
const [Success, SetSuccess] = useState();
|
||||
const [brachName, setbrachName] = useState('');
|
||||
const [UpiOpen, setUpiOpen] = useState(false);
|
||||
const [customerPreviesOrders, setCustomerPreviesOrders] = useState(false);
|
||||
const OverAllSales = useSelector(GlobalOverAllDiscSales);
|
||||
const OverAllEstimate = useSelector(GlobalOverAllDiscEstimate);
|
||||
|
||||
|
|
@ -1414,7 +1415,7 @@ const BSBillingTable2 = () => {
|
|||
|
||||
const selectedStyle =
|
||||
stylesMap[
|
||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||
];
|
||||
|
||||
if (selectedStyle) {
|
||||
|
|
@ -1966,15 +1967,15 @@ const BSBillingTable2 = () => {
|
|||
OrderStatus: 'O',
|
||||
OrderType:
|
||||
BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
Estimation?.SettingValue == 'N'
|
||||
BookingTypeBoth ||
|
||||
Estimation?.SettingValue == 'N'
|
||||
? 'S'
|
||||
: GlobEstBooking === 'OvrAllEst'
|
||||
? 'E'
|
||||
: GlobEstBooking === 'ParEst'
|
||||
? GlobProdwisedata?.includes(
|
||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||
)
|
||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||
)
|
||||
? 'E'
|
||||
: 'S'
|
||||
: 'S',
|
||||
|
|
@ -2066,7 +2067,7 @@ const BSBillingTable2 = () => {
|
|||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? 'S'
|
||||
: 'P',
|
||||
OrderDtlDetails:
|
||||
|
|
@ -2083,9 +2084,9 @@ const BSBillingTable2 = () => {
|
|||
? globalTipAmount === 0
|
||||
? SelectedTableDetails
|
||||
: SelectedTableDetails?.map((item) => ({
|
||||
...item,
|
||||
TipsAmount: globalTipAmount,
|
||||
}))
|
||||
...item,
|
||||
TipsAmount: globalTipAmount,
|
||||
}))
|
||||
: null,
|
||||
// "Credit": TotalAmount,
|
||||
// "Debit": 0,
|
||||
|
|
@ -2100,8 +2101,8 @@ const BSBillingTable2 = () => {
|
|||
? PaymentgatewayUPI?.[0]?.ModeId
|
||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find(
|
||||
(busupi) => busupi?.ModeId === UpiId
|
||||
)?.ModeId
|
||||
(busupi) => busupi?.ModeId === UpiId
|
||||
)?.ModeId
|
||||
: paybtnselected
|
||||
: paybtnselected
|
||||
? paybtnselected
|
||||
|
|
@ -2110,9 +2111,9 @@ const BSBillingTable2 = () => {
|
|||
Amount: Math.round(TotalAmount),
|
||||
MerchantId:
|
||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||
?.MerchantId
|
||||
?.MerchantId
|
||||
: null,
|
||||
PaymentOptionType:
|
||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||
|
|
@ -2131,26 +2132,26 @@ const BSBillingTable2 = () => {
|
|||
ModeOfPayment:
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||
?.UPIDetailId
|
||||
?.UPIDetailId
|
||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||
?.MerchantUPIId
|
||||
?.MerchantUPIId
|
||||
: null,
|
||||
AccountDtl:
|
||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||
(upipay) => upipay?.UPIId === UpiId
|
||||
)
|
||||
(upipay) => upipay?.UPIId === UpiId
|
||||
)
|
||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pd')
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pd')
|
||||
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pg')
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pg')
|
||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||
: [],
|
||||
PaymentStatus:
|
||||
|
|
@ -2159,7 +2160,7 @@ const BSBillingTable2 = () => {
|
|||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? 'S'
|
||||
: 'P',
|
||||
Debit: 0,
|
||||
|
|
@ -2235,14 +2236,14 @@ const BSBillingTable2 = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
response?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2394,14 +2395,14 @@ const BSBillingTable2 = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
response?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2505,14 +2506,14 @@ const BSBillingTable2 = () => {
|
|||
}
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
if (response?.data?.OrderDetails?.length > 0) {
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2689,14 +2690,14 @@ const BSBillingTable2 = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
bookingpaymentupdate?.data?.response +
|
||||
' ' +
|
||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||
? bookingpaymentupdate?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
bookingpaymentupdate?.data?.OrderId,
|
||||
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||
? bookingpaymentupdate?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
bookingpaymentupdate?.data?.OrderId,
|
||||
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
bookingpaymentupdate?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([bookingpaymentupdate?.data]);
|
||||
|
|
@ -2715,7 +2716,7 @@ const BSBillingTable2 = () => {
|
|||
if (
|
||||
Date.now() - startTime >
|
||||
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
|
||||
60000
|
||||
60000
|
||||
) {
|
||||
// 60,000 ms = 1 minute
|
||||
|
||||
|
|
@ -3634,16 +3635,16 @@ const BSBillingTable2 = () => {
|
|||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 'none'
|
||||
: 'auto',
|
||||
opacity:
|
||||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 0.5
|
||||
: 1,
|
||||
width: '2rem',
|
||||
|
|
@ -3663,14 +3664,14 @@ const BSBillingTable2 = () => {
|
|||
width: '1.6rem',
|
||||
cursor:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'not-allowed'
|
||||
: 'pointer',
|
||||
color:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
display: 'flex',
|
||||
|
|
@ -3696,14 +3697,14 @@ const BSBillingTable2 = () => {
|
|||
width: '1.5rem',
|
||||
cursor:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'not-allowed'
|
||||
: 'pointer',
|
||||
color:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
display: 'flex',
|
||||
|
|
@ -3805,16 +3806,16 @@ const BSBillingTable2 = () => {
|
|||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 'none'
|
||||
: 'auto',
|
||||
opacity:
|
||||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 0.5
|
||||
: 1,
|
||||
}}
|
||||
|
|
@ -3825,10 +3826,10 @@ const BSBillingTable2 = () => {
|
|||
<button
|
||||
className={
|
||||
paybtnselected === payment.ModeId &&
|
||||
(UpinotSelected || CardoptionnotSelected)
|
||||
(UpinotSelected || CardoptionnotSelected)
|
||||
? 'Btn-payment-mode-notupisel'
|
||||
: paybtnselected === payment.ModeId &&
|
||||
(!UpinotSelected || !CardoptionnotSelected)
|
||||
(!UpinotSelected || !CardoptionnotSelected)
|
||||
? 'Btn-payment-mode'
|
||||
: 'Btn-payment-mode-sel'
|
||||
}
|
||||
|
|
@ -3842,9 +3843,9 @@ const BSBillingTable2 = () => {
|
|||
onClick={() =>
|
||||
payment?.ModeName?.toLowerCase() === 'upi' // Change the condition to payment.Id
|
||||
? handleUPIButtonClick(
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
: handlePaymentMode(payment.ModeId, payment.ModeName)
|
||||
}
|
||||
>
|
||||
|
|
@ -3933,9 +3934,9 @@ const BSBillingTable2 = () => {
|
|||
OrderCardDetail?.length > 0 && 'not-allowed',
|
||||
color:
|
||||
OrderCardDetail?.length > 0 ||
|
||||
(selOption?.value === undefined &&
|
||||
GlobalAddCustomerDetails1?.length === 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
(selOption?.value === undefined &&
|
||||
GlobalAddCustomerDetails1?.length === 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
fontSize: '28px',
|
||||
|
|
@ -3950,6 +3951,41 @@ const BSBillingTable2 = () => {
|
|||
''
|
||||
)}
|
||||
|
||||
|
||||
{/* Customer Orders */}
|
||||
{GetCustId && (
|
||||
<Tooltip title="Customer Orders" isMobile={isMobile}>
|
||||
{' '}
|
||||
<div
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => {
|
||||
if (
|
||||
CheckBookingStatus !== 'Close' &&
|
||||
!addnewAccess &&
|
||||
!(OrderCardDetail?.length > 0)
|
||||
) {
|
||||
setCustomerPreviesOrders(true);
|
||||
}
|
||||
}}
|
||||
style={{
|
||||
cursor: OrderCardDetail?.length > 0 && 'not-allowed',
|
||||
color:
|
||||
OrderCardDetail?.length > 0 ||
|
||||
(OrderCardDetail?.length > 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
fontSize: '25px',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
height: '2.46rem',
|
||||
width: '1.5rem',
|
||||
}}
|
||||
>
|
||||
<FaCartPlus />
|
||||
</div>
|
||||
</Tooltip>
|
||||
)}
|
||||
{tabledata?.length > 0 && (
|
||||
<div style={{ width: '2rem' }}>
|
||||
{tableOptions
|
||||
|
|
@ -4015,68 +4051,68 @@ const BSBillingTable2 = () => {
|
|||
<>
|
||||
{unpaidFlow == false
|
||||
? item?.OptionName == 'Hold' &&
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
OrderCardDetail?.length != 0 &&
|
||||
!OrderStatus &&
|
||||
OrderType != 'Failed' &&
|
||||
paybtns?.length > 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
!addnewAccess && (
|
||||
<>
|
||||
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
||||
<button
|
||||
onClick={() => AddBookingDetails('Hold')}
|
||||
className={
|
||||
FirstPaymentclick === false
|
||||
? 'hold-btn'
|
||||
: 'hold-btn-disable'
|
||||
}
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
OrderCardDetail?.length != 0 &&
|
||||
!OrderStatus &&
|
||||
OrderType != 'Failed' &&
|
||||
paybtns?.length > 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
!addnewAccess && (
|
||||
<>
|
||||
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
||||
<button
|
||||
onClick={() => AddBookingDetails('Hold')}
|
||||
className={
|
||||
FirstPaymentclick === false
|
||||
? 'hold-btn'
|
||||
: 'hold-btn-disable'
|
||||
}
|
||||
>
|
||||
<BsPauseFill />
|
||||
<p
|
||||
className="hold-btn-txt"
|
||||
style={{
|
||||
fontFamily: FontFamily['para'],
|
||||
}}
|
||||
>
|
||||
<BsPauseFill />
|
||||
<p
|
||||
className="hold-btn-txt"
|
||||
style={{
|
||||
fontFamily: FontFamily['para'],
|
||||
}}
|
||||
>
|
||||
Hold
|
||||
</p>
|
||||
</button>
|
||||
</TooltipWrapper>
|
||||
</>
|
||||
)
|
||||
Hold
|
||||
</p>
|
||||
</button>
|
||||
</TooltipWrapper>
|
||||
</>
|
||||
)
|
||||
: ''}
|
||||
{unpaidFlow == false
|
||||
? item?.OptionName == 'Hold' &&
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
Holddata?.length > 0 &&
|
||||
OrderCardDetail?.length == 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
paybtns?.length > 0 &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper title={'Recall'} isMobile={isMobile}>
|
||||
{' '}
|
||||
<Badge
|
||||
count={Holddata?.length}
|
||||
size={'small'}
|
||||
offset={[0, 7]}
|
||||
>
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => HandleholdModelOpen()}
|
||||
style={{
|
||||
fontSize: '28px',
|
||||
cursor: 'pointer',
|
||||
color: Holddata ? '#52c41a' : 'default',
|
||||
pointerEvents:
|
||||
OrderType === 'Failed' ? 'none' : 'auto',
|
||||
}}
|
||||
/>
|
||||
</Badge>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
Holddata?.length > 0 &&
|
||||
OrderCardDetail?.length == 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
paybtns?.length > 0 &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper title={'Recall'} isMobile={isMobile}>
|
||||
{' '}
|
||||
<Badge
|
||||
count={Holddata?.length}
|
||||
size={'small'}
|
||||
offset={[0, 7]}
|
||||
>
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => HandleholdModelOpen()}
|
||||
style={{
|
||||
fontSize: '28px',
|
||||
cursor: 'pointer',
|
||||
color: Holddata ? '#52c41a' : 'default',
|
||||
pointerEvents:
|
||||
OrderType === 'Failed' ? 'none' : 'auto',
|
||||
}}
|
||||
/>
|
||||
</Badge>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
: ''}
|
||||
</>
|
||||
))}
|
||||
|
|
@ -4092,9 +4128,9 @@ const BSBillingTable2 = () => {
|
|||
addnewAccess
|
||||
? 'billing-btn-deactive'
|
||||
: FirstPaymentclick === false &&
|
||||
OrderCardDetail?.length > 0 &&
|
||||
paybtnselected &&
|
||||
CheckBookingStatus != 'Close'
|
||||
OrderCardDetail?.length > 0 &&
|
||||
paybtnselected &&
|
||||
CheckBookingStatus != 'Close'
|
||||
? 'billing-btn'
|
||||
: 'billing-btn-deactive'
|
||||
}
|
||||
|
|
@ -4460,9 +4496,9 @@ const BSBillingTable2 = () => {
|
|||
|
||||
const qty = isGroup
|
||||
? OrderCardDetail.filter((o) => o.id === groupKey).reduce(
|
||||
(sum, o) => sum + (o.OrderQty || 1),
|
||||
0
|
||||
)
|
||||
(sum, o) => sum + (o.OrderQty || 1),
|
||||
0
|
||||
)
|
||||
: item.OrderQty || 1;
|
||||
|
||||
return (
|
||||
|
|
@ -4542,6 +4578,7 @@ const BSBillingTable2 = () => {
|
|||
</div>
|
||||
}
|
||||
/>
|
||||
|
||||
<DefaultModal
|
||||
open={businessUPI}
|
||||
handleCancel={() => setShowCancelConfirm(true)}
|
||||
|
|
@ -4579,6 +4616,23 @@ const BSBillingTable2 = () => {
|
|||
Do you want to cancel the payment?
|
||||
</Modal>
|
||||
)}
|
||||
{customerPreviesOrders && (
|
||||
<DefaultModal
|
||||
open={customerPreviesOrders}
|
||||
handleCancel={() => setCustomerPreviesOrders(false)}
|
||||
footer={false}
|
||||
width={700}
|
||||
className={'ModalPaymentGatewayEmbedded'}
|
||||
children={
|
||||
<>
|
||||
<CustomerOrders
|
||||
CustomerDetails={selOption}
|
||||
close={() => setCustomerPreviesOrders(false)}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import {
|
|||
DownCircleOutlined,
|
||||
UpOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import { Popover, Badge, Modal } from 'antd';
|
||||
import { Popover, Badge, Modal, Tooltip } from 'antd';
|
||||
import {
|
||||
printDiv,
|
||||
extractLastNumberOrderId,
|
||||
|
|
@ -186,7 +186,7 @@ import { getCombolist } from '../../../../../Features/ComboMaster/ComboMaster.js
|
|||
import SMSShare from '../../../../WhatsAppShare/SmsShare.jsx';
|
||||
import WhatsAppShare from '../../../../WhatsAppShare/whatsAppShare.jsx';
|
||||
import { MdSms } from 'react-icons/md';
|
||||
import { FaWhatsapp, FaPrint } from 'react-icons/fa';
|
||||
import { FaWhatsapp, FaPrint, FaCartPlus } from 'react-icons/fa';
|
||||
import BSTipAmount from '../../UtillComponents/BSTipAmount.jsx';
|
||||
import { ApplicationPreferences } from '../../../../../Features/BrachLogin/BranchLogin.js';
|
||||
import { PostOtherServices } from '../../../../../Features/OtherServices/OtherServices.js';
|
||||
|
|
@ -210,6 +210,7 @@ import UpiPopover from '../StandardTable/Utils/UpiPopOver.jsx';
|
|||
import PaymentGatewayEmbedded from '../../UtillComponents/PaymentGatewayEmbedded.jsx';
|
||||
import MobileMultiPdfPrintTrigger from '../../UtillComponents/MobileMultiPdfPrintTrigger.jsx';
|
||||
import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/DateStore.js';
|
||||
import CustomerOrders from '../../BookingFunctionality/CustomerOrders.jsx';
|
||||
|
||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
||||
|
|
@ -898,7 +899,7 @@ const BSBillingTable3Pay = () => {
|
|||
|
||||
const selectedStyle =
|
||||
stylesMap[
|
||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||
];
|
||||
|
||||
if (selectedStyle) {
|
||||
|
|
@ -2112,15 +2113,15 @@ const BSBillingTable3Pay = () => {
|
|||
OrderStatus: 'O',
|
||||
OrderType:
|
||||
BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
Estimation?.SettingValue == 'N'
|
||||
BookingTypeBoth ||
|
||||
Estimation?.SettingValue == 'N'
|
||||
? 'S'
|
||||
: GlobEstBooking === 'OvrAllEst'
|
||||
? 'E'
|
||||
: GlobEstBooking === 'ParEst'
|
||||
? GlobProdwisedata?.includes(
|
||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||
)
|
||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||
)
|
||||
? 'E'
|
||||
: 'S'
|
||||
: 'S',
|
||||
|
|
@ -2212,7 +2213,7 @@ const BSBillingTable3Pay = () => {
|
|||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? 'S'
|
||||
: 'P',
|
||||
OrderDtlDetails:
|
||||
|
|
@ -2229,9 +2230,9 @@ const BSBillingTable3Pay = () => {
|
|||
? globalTipAmount === 0
|
||||
? SelectedTableDetails
|
||||
: SelectedTableDetails?.map((item) => ({
|
||||
...item,
|
||||
TipsAmount: globalTipAmount,
|
||||
}))
|
||||
...item,
|
||||
TipsAmount: globalTipAmount,
|
||||
}))
|
||||
: null,
|
||||
SalesPaymentType: 'normal',
|
||||
PaymentDetail: [
|
||||
|
|
@ -2244,8 +2245,8 @@ const BSBillingTable3Pay = () => {
|
|||
? PaymentgatewayUPI?.[0]?.ModeId
|
||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find(
|
||||
(busupi) => busupi?.ModeId === UpiId
|
||||
)?.ModeId
|
||||
(busupi) => busupi?.ModeId === UpiId
|
||||
)?.ModeId
|
||||
: paybtnselected
|
||||
: paybtnselected
|
||||
? paybtnselected
|
||||
|
|
@ -2253,9 +2254,9 @@ const BSBillingTable3Pay = () => {
|
|||
Amount: Math.round(TotalAmount),
|
||||
MerchantId:
|
||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||
?.MerchantId
|
||||
?.MerchantId
|
||||
: null,
|
||||
PaymentOptionType:
|
||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||
|
|
@ -2274,26 +2275,26 @@ const BSBillingTable3Pay = () => {
|
|||
ModeOfPayment:
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||
?.UPIDetailId
|
||||
?.UPIDetailId
|
||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||
?.MerchantUPIId
|
||||
?.MerchantUPIId
|
||||
: null,
|
||||
AccountDtl:
|
||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||
(upipay) => upipay?.UPIId === UpiId
|
||||
)
|
||||
(upipay) => upipay?.UPIId === UpiId
|
||||
)
|
||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pd')
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pd')
|
||||
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pg')
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pg')
|
||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||
: [],
|
||||
PaymentStatus:
|
||||
|
|
@ -2302,7 +2303,7 @@ const BSBillingTable3Pay = () => {
|
|||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? 'S'
|
||||
: 'P',
|
||||
Debit: 0,
|
||||
|
|
@ -2377,14 +2378,14 @@ const BSBillingTable3Pay = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
response?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2539,14 +2540,14 @@ const BSBillingTable3Pay = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
response?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2649,14 +2650,14 @@ const BSBillingTable3Pay = () => {
|
|||
}
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
if (response?.data?.OrderDetails?.length > 0) {
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2833,14 +2834,14 @@ const BSBillingTable3Pay = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
bookingpaymentupdate?.data?.response +
|
||||
' ' +
|
||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||
? bookingpaymentupdate?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
bookingpaymentupdate?.data?.OrderId,
|
||||
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||
? bookingpaymentupdate?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
bookingpaymentupdate?.data?.OrderId,
|
||||
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
bookingpaymentupdate?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([bookingpaymentupdate?.data]);
|
||||
|
|
@ -2859,7 +2860,7 @@ const BSBillingTable3Pay = () => {
|
|||
if (
|
||||
Date.now() - startTime >
|
||||
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
|
||||
60000
|
||||
60000
|
||||
) {
|
||||
// 60,000 ms = 1 minute
|
||||
|
||||
|
|
@ -3571,9 +3572,9 @@ const BSBillingTable3Pay = () => {
|
|||
OrderCardDetail?.length > 0 && 'not-allowed',
|
||||
color:
|
||||
OrderCardDetail?.length > 0 ||
|
||||
(selOption?.value === undefined &&
|
||||
GlobalAddCustomerDetails1?.length === 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
(selOption?.value === undefined &&
|
||||
GlobalAddCustomerDetails1?.length === 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
fontSize: '28px',
|
||||
|
|
@ -3595,16 +3596,16 @@ const BSBillingTable3Pay = () => {
|
|||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 'none'
|
||||
: 'auto',
|
||||
opacity:
|
||||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 0.5
|
||||
: 1,
|
||||
width: '2rem',
|
||||
|
|
@ -3627,14 +3628,14 @@ const BSBillingTable3Pay = () => {
|
|||
width: '1.5rem',
|
||||
cursor:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'not-allowed'
|
||||
: 'pointer',
|
||||
color:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
display: 'flex',
|
||||
|
|
@ -3648,7 +3649,41 @@ const BSBillingTable3Pay = () => {
|
|||
)}
|
||||
</div>
|
||||
)}
|
||||
{/* Customer Orders */}
|
||||
{GetCustId && (
|
||||
|
||||
<Tooltip title="Customer Orders" isMobile={isMobile}>
|
||||
{' '}
|
||||
<div
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => {
|
||||
if (
|
||||
CheckBookingStatus !== 'Close' &&
|
||||
!addnewAccess &&
|
||||
!(OrderCardDetail?.length > 0)
|
||||
) {
|
||||
setCustomerPreviesOrders(true);
|
||||
}
|
||||
}}
|
||||
style={{
|
||||
cursor: OrderCardDetail?.length > 0 && 'not-allowed',
|
||||
color:
|
||||
OrderCardDetail?.length > 0 ||
|
||||
(OrderCardDetail?.length > 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
fontSize: '25px',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
height: '2.46rem',
|
||||
width: '1.5rem',
|
||||
}}
|
||||
>
|
||||
<FaCartPlus />
|
||||
</div>
|
||||
</Tooltip>
|
||||
)}
|
||||
{tabledata?.length > 0 && (
|
||||
<>
|
||||
{tableOptions
|
||||
|
|
@ -3722,65 +3757,65 @@ const BSBillingTable3Pay = () => {
|
|||
<>
|
||||
{unpaidFlow == false
|
||||
? item?.OptionName == 'Hold' &&
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
OrderCardDetail?.length != 0 &&
|
||||
CheckOrderType?.length === 0 &&
|
||||
OrderType != 'Failed' &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
paybtns?.length > 0 &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper
|
||||
title={'Hold (Alt+W)'}
|
||||
isMobile={isMobile}
|
||||
>
|
||||
{' '}
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => AddBookingDetails('Hold', false)}
|
||||
style={{
|
||||
fontSize: '30px',
|
||||
cursor: 'pointer',
|
||||
color: '' ? '#52c41a' : '#1292EE',
|
||||
}}
|
||||
/>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
OrderCardDetail?.length != 0 &&
|
||||
CheckOrderType?.length === 0 &&
|
||||
OrderType != 'Failed' &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
paybtns?.length > 0 &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper
|
||||
title={'Hold (Alt+W)'}
|
||||
isMobile={isMobile}
|
||||
>
|
||||
{' '}
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => AddBookingDetails('Hold', false)}
|
||||
style={{
|
||||
fontSize: '30px',
|
||||
cursor: 'pointer',
|
||||
color: '' ? '#52c41a' : '#1292EE',
|
||||
}}
|
||||
/>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
: ''}
|
||||
{unpaidFlow == false
|
||||
? item?.OptionName == 'Hold' &&
|
||||
paybtns?.length > 0 &&
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
Holddata?.length > 0 &&
|
||||
paybtns?.length > 0 &&
|
||||
OrderCardDetail?.length == 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper
|
||||
title={'Recall (Alt+W)'}
|
||||
isMobile={isMobile}
|
||||
paybtns?.length > 0 &&
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
Holddata?.length > 0 &&
|
||||
paybtns?.length > 0 &&
|
||||
OrderCardDetail?.length == 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper
|
||||
title={'Recall (Alt+W)'}
|
||||
isMobile={isMobile}
|
||||
>
|
||||
{' '}
|
||||
<Badge
|
||||
count={Holddata?.length}
|
||||
size={'small'}
|
||||
offset={[0, 7]}
|
||||
>
|
||||
{' '}
|
||||
<Badge
|
||||
count={Holddata?.length}
|
||||
size={'small'}
|
||||
offset={[0, 7]}
|
||||
>
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => HandleholdModelOpen()}
|
||||
style={{
|
||||
fontSize: '28px',
|
||||
cursor: 'pointer',
|
||||
color: Holddata ? '#52c41a' : 'default',
|
||||
pointerEvents:
|
||||
OrderType === 'Failed' ? 'none' : 'auto',
|
||||
}}
|
||||
/>
|
||||
</Badge>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => HandleholdModelOpen()}
|
||||
style={{
|
||||
fontSize: '28px',
|
||||
cursor: 'pointer',
|
||||
color: Holddata ? '#52c41a' : 'default',
|
||||
pointerEvents:
|
||||
OrderType === 'Failed' ? 'none' : 'auto',
|
||||
}}
|
||||
/>
|
||||
</Badge>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
: ''}
|
||||
</>
|
||||
))}
|
||||
|
|
@ -3826,14 +3861,14 @@ const BSBillingTable3Pay = () => {
|
|||
width: '1.5rem',
|
||||
cursor:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'not-allowed'
|
||||
: 'pointer',
|
||||
color:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
display: 'flex',
|
||||
|
|
@ -3903,16 +3938,16 @@ const BSBillingTable3Pay = () => {
|
|||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 'none'
|
||||
: 'auto',
|
||||
opacity:
|
||||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 0.5
|
||||
: 1,
|
||||
}}
|
||||
|
|
@ -3923,10 +3958,10 @@ const BSBillingTable3Pay = () => {
|
|||
<button
|
||||
className={
|
||||
paybtnselected === payment.ModeId &&
|
||||
(UpinotSelected || CardoptionnotSelected)
|
||||
(UpinotSelected || CardoptionnotSelected)
|
||||
? 'Btn-payment-mode-notupisel'
|
||||
: paybtnselected === payment.ModeId &&
|
||||
(!UpinotSelected || !CardoptionnotSelected)
|
||||
(!UpinotSelected || !CardoptionnotSelected)
|
||||
? 'Btn-payment-mode'
|
||||
: 'Btn-payment-mode-sel'
|
||||
}
|
||||
|
|
@ -3940,13 +3975,13 @@ const BSBillingTable3Pay = () => {
|
|||
onClick={() =>
|
||||
payment?.ModeName?.toLowerCase() === 'upi' // Change the condition to payment.Id
|
||||
? handleUPIButtonClick(
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
: handlePaymentMode(
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
}
|
||||
>
|
||||
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
||||
|
|
@ -4236,9 +4271,9 @@ const BSBillingTable3Pay = () => {
|
|||
addnewAccess
|
||||
? 'BSBillingTable3-paybtn-deactive'
|
||||
: FirstPaymentclick === false &&
|
||||
OrderCardDetail?.length > 0 &&
|
||||
paybtnselected &&
|
||||
CheckBookingStatus != 'Close'
|
||||
OrderCardDetail?.length > 0 &&
|
||||
paybtnselected &&
|
||||
CheckBookingStatus != 'Close'
|
||||
? !OrderStatus
|
||||
? 'BSBillingTable3-paybtn'
|
||||
: 'BSBillingTable3-paybtn Order'
|
||||
|
|
@ -4253,7 +4288,7 @@ const BSBillingTable3Pay = () => {
|
|||
// financialYearError:
|
||||
handleButtonClick
|
||||
}
|
||||
//dhana
|
||||
//dhana
|
||||
>
|
||||
{!OrderStatus ? (
|
||||
<>
|
||||
|
|
@ -4546,9 +4581,9 @@ const BSBillingTable3Pay = () => {
|
|||
|
||||
const qty = isGroup
|
||||
? OrderCardDetail.filter((o) => o.id === groupKey).reduce(
|
||||
(sum, o) => sum + (o.OrderQty || 1),
|
||||
0
|
||||
)
|
||||
(sum, o) => sum + (o.OrderQty || 1),
|
||||
0
|
||||
)
|
||||
: item.OrderQty || 1;
|
||||
|
||||
return (
|
||||
|
|
@ -4663,6 +4698,23 @@ const BSBillingTable3Pay = () => {
|
|||
Do you want to cancel the payment?
|
||||
</Modal>
|
||||
)}
|
||||
{customerPreviesOrders && (
|
||||
<DefaultModal
|
||||
open={customerPreviesOrders}
|
||||
handleCancel={() => setCustomerPreviesOrders(false)}
|
||||
footer={false}
|
||||
width={700}
|
||||
className={'ModalPaymentGatewayEmbedded'}
|
||||
children={
|
||||
<>
|
||||
<CustomerOrders
|
||||
CustomerDetails={selOption}
|
||||
close={() => setCustomerPreviesOrders(false)}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import React, { useEffect, useState, useRef } from 'react';
|
|||
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import moment from 'moment';
|
||||
import { Badge, Modal, Popover } from 'antd';
|
||||
import { Badge, Modal, Popover, Tooltip } from 'antd';
|
||||
import { BiRightArrowAlt } from 'react-icons/bi';
|
||||
import { AiOutlineClose } from 'react-icons/ai';
|
||||
import BSSummery from '../BSBillingTableSummery/BSSummery';
|
||||
|
|
@ -190,7 +190,7 @@ import { getCombolist } from '../../../../../Features/ComboMaster/ComboMaster.js
|
|||
import WhatsAppShare from '../../../../WhatsAppShare/whatsAppShare.jsx';
|
||||
import SMSShare from '../../../../WhatsAppShare/SmsShare.jsx';
|
||||
import { MdSms } from 'react-icons/md';
|
||||
import { FaWhatsapp, FaPrint } from 'react-icons/fa';
|
||||
import { FaWhatsapp, FaPrint, FaCartPlus } from 'react-icons/fa';
|
||||
import BSTipAmount from '../../UtillComponents/BSTipAmount.jsx';
|
||||
import { ApplicationPreferences } from '../../../../../Features/BrachLogin/BranchLogin.js';
|
||||
import { PostOtherServices } from '../../../../../Features/OtherServices/OtherServices.js';
|
||||
|
|
@ -215,6 +215,7 @@ import CardPopover from '../StandardTable/Utils/CardPopover.jsx';
|
|||
import PaymentGatewayEmbedded from '../../UtillComponents/PaymentGatewayEmbedded.jsx';
|
||||
import pozologoimg from '../../../../../Images/pozologoimg.png';
|
||||
import MobileMultiPdfPrintTrigger from '../../UtillComponents/MobileMultiPdfPrintTrigger.jsx';
|
||||
import CustomerOrders from '../../BookingFunctionality/CustomerOrders.jsx';
|
||||
|
||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
||||
|
|
@ -319,6 +320,7 @@ const BSBilling4Payment = () => {
|
|||
const [paymentModeDisplay, setPaymentModeDisplay] = useState(true);
|
||||
const [messageType, setMessageType] = useState(null);
|
||||
const [messageData, setMessageData] = useState(null);
|
||||
const [customerPreviesOrders, setCustomerPreviesOrders] = useState(false);
|
||||
const SessionData = useSelector(StoredSessionData);
|
||||
const AppId = SessionData?.AppId;
|
||||
const CompId = SessionData?.CompId;
|
||||
|
|
@ -773,7 +775,7 @@ const BSBilling4Payment = () => {
|
|||
|
||||
const selectedStyle =
|
||||
stylesMap[
|
||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||
];
|
||||
console.log(selectedStyle, style, 'style');
|
||||
if (selectedStyle) {
|
||||
|
|
@ -1996,15 +1998,15 @@ const BSBilling4Payment = () => {
|
|||
OrderStatus: 'O',
|
||||
OrderType:
|
||||
BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
Estimation?.SettingValue == 'N'
|
||||
BookingTypeBoth ||
|
||||
Estimation?.SettingValue == 'N'
|
||||
? 'S'
|
||||
: GlobEstBooking === 'OvrAllEst'
|
||||
? 'E'
|
||||
: GlobEstBooking === 'ParEst'
|
||||
? GlobProdwisedata?.includes(
|
||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||
)
|
||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||
)
|
||||
? 'E'
|
||||
: 'S'
|
||||
: 'S',
|
||||
|
|
@ -2097,7 +2099,7 @@ const BSBilling4Payment = () => {
|
|||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? 'S'
|
||||
: 'P',
|
||||
OrderDtlDetails:
|
||||
|
|
@ -2114,9 +2116,9 @@ const BSBilling4Payment = () => {
|
|||
? globalTipAmount === 0
|
||||
? SelectedTableDetails
|
||||
: SelectedTableDetails?.map((item) => ({
|
||||
...item,
|
||||
TipsAmount: globalTipAmount,
|
||||
}))
|
||||
...item,
|
||||
TipsAmount: globalTipAmount,
|
||||
}))
|
||||
: null,
|
||||
SalesPaymentType: 'normal',
|
||||
PaymentDetail: [
|
||||
|
|
@ -2129,8 +2131,8 @@ const BSBilling4Payment = () => {
|
|||
? PaymentgatewayUPI?.[0]?.ModeId
|
||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find(
|
||||
(busupi) => busupi?.ModeId === UpiId
|
||||
)?.ModeId
|
||||
(busupi) => busupi?.ModeId === UpiId
|
||||
)?.ModeId
|
||||
: paybtnselected
|
||||
: paybtnselected
|
||||
? paybtnselected
|
||||
|
|
@ -2138,9 +2140,9 @@ const BSBilling4Payment = () => {
|
|||
Amount: Math.round(TotalAmount),
|
||||
MerchantId:
|
||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||
?.MerchantId
|
||||
?.MerchantId
|
||||
: null,
|
||||
PaymentOptionType:
|
||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||
|
|
@ -2159,26 +2161,26 @@ const BSBilling4Payment = () => {
|
|||
ModeOfPayment:
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||
?.UPIDetailId
|
||||
?.UPIDetailId
|
||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||
?.MerchantUPIId
|
||||
?.MerchantUPIId
|
||||
: null,
|
||||
AccountDtl:
|
||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||
(upipay) => upipay?.UPIId === UpiId
|
||||
)
|
||||
(upipay) => upipay?.UPIId === UpiId
|
||||
)
|
||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pd')
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pd')
|
||||
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pg')
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pg')
|
||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||
: [],
|
||||
PaymentStatus:
|
||||
|
|
@ -2187,7 +2189,7 @@ const BSBilling4Payment = () => {
|
|||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? 'S'
|
||||
: 'P',
|
||||
Debit: 0,
|
||||
|
|
@ -2262,14 +2264,14 @@ const BSBilling4Payment = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
response?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2425,14 +2427,14 @@ const BSBilling4Payment = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
response?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2539,14 +2541,14 @@ const BSBilling4Payment = () => {
|
|||
}
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
if (response?.data?.OrderDetails?.length > 0) {
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2722,14 +2724,14 @@ const BSBilling4Payment = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
bookingpaymentupdate?.data?.response +
|
||||
' ' +
|
||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||
? bookingpaymentupdate?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
bookingpaymentupdate?.data?.OrderId,
|
||||
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||
? bookingpaymentupdate?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
bookingpaymentupdate?.data?.OrderId,
|
||||
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
bookingpaymentupdate?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([bookingpaymentupdate?.data]);
|
||||
|
|
@ -2748,7 +2750,7 @@ const BSBilling4Payment = () => {
|
|||
if (
|
||||
Date.now() - startTime >
|
||||
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
|
||||
60000
|
||||
60000
|
||||
) {
|
||||
// 60,000 ms = 1 minute
|
||||
|
||||
|
|
@ -2985,9 +2987,9 @@ const BSBilling4Payment = () => {
|
|||
AppId: AppId,
|
||||
...(AvailableDate && selectedDate
|
||||
? {
|
||||
fromDate: selectedDate?.[0],
|
||||
toDate: selectedDate?.[1],
|
||||
}
|
||||
fromDate: selectedDate?.[0],
|
||||
toDate: selectedDate?.[1],
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
await dispatch(getSelectedFavItems(data)).unwrap();
|
||||
|
|
@ -2999,9 +3001,9 @@ const BSBilling4Payment = () => {
|
|||
ProdSubCat: ProdSubCat,
|
||||
...(AvailableDate && selectedDate
|
||||
? {
|
||||
fromDate: selectedDate?.[0],
|
||||
toDate: selectedDate?.[1],
|
||||
}
|
||||
fromDate: selectedDate?.[0],
|
||||
toDate: selectedDate?.[1],
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
|
||||
|
|
@ -3012,9 +3014,9 @@ const BSBilling4Payment = () => {
|
|||
prodCat: prodCat,
|
||||
...(AvailableDate && selectedDate
|
||||
? {
|
||||
fromDate: selectedDate?.[0],
|
||||
toDate: selectedDate?.[1],
|
||||
}
|
||||
fromDate: selectedDate?.[0],
|
||||
toDate: selectedDate?.[1],
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
|
||||
|
|
@ -3629,9 +3631,9 @@ const BSBilling4Payment = () => {
|
|||
OrderCardDetail?.length > 0 && 'not-allowed',
|
||||
color:
|
||||
OrderCardDetail?.length > 0 ||
|
||||
(selOption?.value === undefined &&
|
||||
GlobalAddCustomerDetails1?.length === 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
(selOption?.value === undefined &&
|
||||
GlobalAddCustomerDetails1?.length === 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
fontSize: '28px',
|
||||
|
|
@ -3652,16 +3654,16 @@ const BSBilling4Payment = () => {
|
|||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 'none'
|
||||
: 'auto',
|
||||
opacity:
|
||||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 0.5
|
||||
: 1,
|
||||
width: '2rem',
|
||||
|
|
@ -3682,14 +3684,14 @@ const BSBilling4Payment = () => {
|
|||
width: '1.5rem',
|
||||
cursor:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'not-allowed'
|
||||
: 'pointer',
|
||||
color:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
display: 'flex',
|
||||
|
|
@ -3701,6 +3703,40 @@ const BSBilling4Payment = () => {
|
|||
</div>
|
||||
</TooltipWrapper>
|
||||
)}
|
||||
{/* Customer Orders */}
|
||||
{GetCustId && (
|
||||
<Tooltip title="Customer Orders" isMobile={isMobile}>
|
||||
{' '}
|
||||
<div
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => {
|
||||
if (
|
||||
CheckBookingStatus !== 'Close' &&
|
||||
!addnewAccess &&
|
||||
!(OrderCardDetail?.length > 0)
|
||||
) {
|
||||
setCustomerPreviesOrders(true);
|
||||
}
|
||||
}}
|
||||
style={{
|
||||
cursor: OrderCardDetail?.length > 0 && 'not-allowed',
|
||||
color:
|
||||
OrderCardDetail?.length > 0 ||
|
||||
(OrderCardDetail?.length > 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
fontSize: '25px',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
height: '2.46rem',
|
||||
width: '1.5rem',
|
||||
}}
|
||||
>
|
||||
<FaCartPlus />
|
||||
</div>
|
||||
</Tooltip>
|
||||
)}
|
||||
{OtherServicesglobal && OrderCardDetail.length >= 1 && (
|
||||
<TooltipWrapper title="Vehicle Number" isMobile={isMobile}>
|
||||
{' '}
|
||||
|
|
@ -3715,14 +3751,14 @@ const BSBilling4Payment = () => {
|
|||
width: '1.5rem',
|
||||
cursor:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'not-allowed'
|
||||
: 'pointer',
|
||||
color:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
display: 'flex',
|
||||
|
|
@ -3804,61 +3840,61 @@ const BSBilling4Payment = () => {
|
|||
<>
|
||||
{unpaidFlow == false
|
||||
? item?.OptionName == 'Hold' &&
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
OrderCardDetail?.length != 0 &&
|
||||
CheckOrderType?.length === 0 &&
|
||||
OrderType != 'Failed' &&
|
||||
paybtns?.length > 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
||||
{' '}
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => AddBookingDetails('Hold')}
|
||||
style={{
|
||||
fontSize: '30px',
|
||||
cursor: 'pointer',
|
||||
color: '' ? '#52c41a' : '#1292EE',
|
||||
}}
|
||||
/>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
OrderCardDetail?.length != 0 &&
|
||||
CheckOrderType?.length === 0 &&
|
||||
OrderType != 'Failed' &&
|
||||
paybtns?.length > 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
||||
{' '}
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => AddBookingDetails('Hold')}
|
||||
style={{
|
||||
fontSize: '30px',
|
||||
cursor: 'pointer',
|
||||
color: '' ? '#52c41a' : '#1292EE',
|
||||
}}
|
||||
/>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
: ''}
|
||||
{unpaidFlow == false
|
||||
? item?.OptionName == 'Hold' &&
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
Holddata?.length > 0 &&
|
||||
OrderCardDetail?.length == 0 &&
|
||||
paybtns?.length > 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper
|
||||
title={'Recall'}
|
||||
isMobile={isMobile}
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
Holddata?.length > 0 &&
|
||||
OrderCardDetail?.length == 0 &&
|
||||
paybtns?.length > 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper
|
||||
title={'Recall'}
|
||||
isMobile={isMobile}
|
||||
>
|
||||
{' '}
|
||||
<Badge
|
||||
count={Holddata?.length}
|
||||
size={'small'}
|
||||
offset={[0, 7]}
|
||||
>
|
||||
{' '}
|
||||
<Badge
|
||||
count={Holddata?.length}
|
||||
size={'small'}
|
||||
offset={[0, 7]}
|
||||
>
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => HandleholdModelOpen()}
|
||||
style={{
|
||||
fontSize: '28px',
|
||||
cursor: 'pointer',
|
||||
color: Holddata ? '#52c41a' : 'default',
|
||||
pointerEvents:
|
||||
OrderType === 'Failed' ? 'none' : 'auto',
|
||||
}}
|
||||
/>
|
||||
</Badge>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => HandleholdModelOpen()}
|
||||
style={{
|
||||
fontSize: '28px',
|
||||
cursor: 'pointer',
|
||||
color: Holddata ? '#52c41a' : 'default',
|
||||
pointerEvents:
|
||||
OrderType === 'Failed' ? 'none' : 'auto',
|
||||
}}
|
||||
/>
|
||||
</Badge>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
: ''}
|
||||
</>
|
||||
))}
|
||||
|
|
@ -3884,16 +3920,16 @@ const BSBilling4Payment = () => {
|
|||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 'none'
|
||||
: 'auto',
|
||||
opacity:
|
||||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 0.5
|
||||
: 1,
|
||||
}}
|
||||
|
|
@ -3904,10 +3940,10 @@ const BSBilling4Payment = () => {
|
|||
<button
|
||||
className={
|
||||
paybtnselected === payment.ModeId &&
|
||||
(UpinotSelected || CardoptionnotSelected)
|
||||
(UpinotSelected || CardoptionnotSelected)
|
||||
? 'Btn-payment-mode-notupisel'
|
||||
: paybtnselected === payment.ModeId &&
|
||||
(!UpinotSelected || !CardoptionnotSelected)
|
||||
(!UpinotSelected || !CardoptionnotSelected)
|
||||
? 'Btn-payment-mode'
|
||||
: 'Btn-payment-mode-sel'
|
||||
}
|
||||
|
|
@ -3921,13 +3957,13 @@ const BSBilling4Payment = () => {
|
|||
onClick={() =>
|
||||
payment?.ModeName?.toLowerCase() === 'upi' // Change the condition to payment.Id
|
||||
? handleUPIButtonClick(
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
: handlePaymentMode(
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
}
|
||||
>
|
||||
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
||||
|
|
@ -4210,9 +4246,9 @@ const BSBilling4Payment = () => {
|
|||
addnewAccess
|
||||
? 'Table4-Btn-final-price-disabled'
|
||||
: FirstPaymentclick === false &&
|
||||
OrderCardDetail?.length > 0 &&
|
||||
paybtnselected &&
|
||||
CheckBookingStatus != 'Close'
|
||||
OrderCardDetail?.length > 0 &&
|
||||
paybtnselected &&
|
||||
CheckBookingStatus != 'Close'
|
||||
? !OrderStatus
|
||||
? 'Table4-Btn-final-price'
|
||||
: 'Table4-Btn-final-price order'
|
||||
|
|
@ -4232,7 +4268,7 @@ const BSBilling4Payment = () => {
|
|||
<div
|
||||
className="Table4-rate"
|
||||
style={{ fontFamily: FontFamily['head'] }}
|
||||
// onClick={() => AddBookingDetails(BookingType, true)}
|
||||
// onClick={() => AddBookingDetails(BookingType, true)}
|
||||
>
|
||||
{isMobile ? (
|
||||
`₹ ${Math.round(
|
||||
|
|
@ -4423,8 +4459,8 @@ const BSBilling4Payment = () => {
|
|||
columns={columns}
|
||||
data={TableData}
|
||||
dataSource={TableData}
|
||||
// pagination={handlePageChange}
|
||||
// onChange={handleChange}
|
||||
// pagination={handlePageChange}
|
||||
// onChange={handleChange}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
|
|
@ -4529,9 +4565,9 @@ const BSBilling4Payment = () => {
|
|||
|
||||
const qty = isGroup
|
||||
? OrderCardDetail.filter((o) => o.id === groupKey).reduce(
|
||||
(sum, o) => sum + (o.OrderQty || 1),
|
||||
0
|
||||
)
|
||||
(sum, o) => sum + (o.OrderQty || 1),
|
||||
0
|
||||
)
|
||||
: item.OrderQty || 1;
|
||||
|
||||
return (
|
||||
|
|
@ -4646,6 +4682,23 @@ const BSBilling4Payment = () => {
|
|||
Do you want to cancel the payment?
|
||||
</Modal>
|
||||
)}
|
||||
{customerPreviesOrders && (
|
||||
<DefaultModal
|
||||
open={customerPreviesOrders}
|
||||
handleCancel={() => setCustomerPreviesOrders(false)}
|
||||
footer={false}
|
||||
width={700}
|
||||
className={'ModalPaymentGatewayEmbedded'}
|
||||
children={
|
||||
<>
|
||||
<CustomerOrders
|
||||
CustomerDetails={selOption}
|
||||
close={() => setCustomerPreviesOrders(false)}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React, { useEffect, useState, useRef } from 'react';
|
||||
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
||||
import moment from 'moment';
|
||||
import { Popover, Badge, Modal } from 'antd';
|
||||
import { Popover, Badge, Modal, Tooltip } from 'antd';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import {
|
||||
UpOutlined,
|
||||
|
|
@ -188,7 +188,7 @@ import { getCombolist } from '../../../../../Features/ComboMaster/ComboMaster.js
|
|||
import WhatsAppShare from '../../../../WhatsAppShare/whatsAppShare.jsx';
|
||||
import SMSShare from '../../../../WhatsAppShare/SmsShare.jsx';
|
||||
import { MdSms } from 'react-icons/md';
|
||||
import { FaWhatsapp, FaPrint } from 'react-icons/fa';
|
||||
import { FaWhatsapp, FaPrint, FaCartPlus } from 'react-icons/fa';
|
||||
import BSTipAmount from '../../UtillComponents/BSTipAmount.jsx';
|
||||
import { ApplicationPreferences } from '../../../../../Features/BrachLogin/BranchLogin.js';
|
||||
import { PostOtherServices } from '../../../../../Features/OtherServices/OtherServices.js';
|
||||
|
|
@ -381,6 +381,7 @@ const BSBillingTable5 = () => {
|
|||
const defaultPaymentTrigger = useSelector(GlobalPaymentTrigger);
|
||||
const [defaultPaymentMode, setDefaultPaymentMode] = useState([]);
|
||||
const [defaultEnabled, setDefaultEnabled] = useState(false);
|
||||
const [customerPreviesOrders, setCustomerPreviesOrders] = useState(false);
|
||||
// Usage
|
||||
const allowedNames = ['whatsapp', 'Print', 'SMS'];
|
||||
const [MobileNoWhatsApp, setMobileNoWhatsApp] = useState();
|
||||
|
|
@ -1055,7 +1056,7 @@ const BSBillingTable5 = () => {
|
|||
|
||||
const selectedStyle =
|
||||
stylesMap[
|
||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||
];
|
||||
|
||||
if (selectedStyle) {
|
||||
|
|
@ -2010,15 +2011,15 @@ const BSBillingTable5 = () => {
|
|||
OrderStatus: 'O',
|
||||
OrderType:
|
||||
BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
Estimation?.SettingValue == 'N'
|
||||
BookingTypeBoth ||
|
||||
Estimation?.SettingValue == 'N'
|
||||
? 'S'
|
||||
: GlobEstBooking === 'OvrAllEst'
|
||||
? 'E'
|
||||
: GlobEstBooking === 'ParEst'
|
||||
? GlobProdwisedata?.includes(
|
||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||
)
|
||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||
)
|
||||
? 'E'
|
||||
: 'S'
|
||||
: 'S',
|
||||
|
|
@ -2109,7 +2110,7 @@ const BSBillingTable5 = () => {
|
|||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? 'S'
|
||||
: 'P',
|
||||
OrderDtlDetails:
|
||||
|
|
@ -2126,9 +2127,9 @@ const BSBillingTable5 = () => {
|
|||
? globalTipAmount === 0
|
||||
? SelectedTableDetails
|
||||
: SelectedTableDetails?.map((item) => ({
|
||||
...item,
|
||||
TipsAmount: globalTipAmount,
|
||||
}))
|
||||
...item,
|
||||
TipsAmount: globalTipAmount,
|
||||
}))
|
||||
: null,
|
||||
SalesPaymentType: 'normal',
|
||||
PaymentDetail: [
|
||||
|
|
@ -2141,8 +2142,8 @@ const BSBillingTable5 = () => {
|
|||
? PaymentgatewayUPI?.[0]?.ModeId
|
||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find(
|
||||
(busupi) => busupi?.ModeId === UpiId
|
||||
)?.ModeId
|
||||
(busupi) => busupi?.ModeId === UpiId
|
||||
)?.ModeId
|
||||
: paybtnselected
|
||||
: paybtnselected
|
||||
? paybtnselected
|
||||
|
|
@ -2150,9 +2151,9 @@ const BSBillingTable5 = () => {
|
|||
Amount: Math.round(TotalAmount),
|
||||
MerchantId:
|
||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||
?.MerchantId
|
||||
?.MerchantId
|
||||
: null,
|
||||
PaymentOptionType:
|
||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||
|
|
@ -2171,26 +2172,26 @@ const BSBillingTable5 = () => {
|
|||
ModeOfPayment:
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||
?.UPIDetailId
|
||||
?.UPIDetailId
|
||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||
?.MerchantUPIId
|
||||
?.MerchantUPIId
|
||||
: null,
|
||||
AccountDtl:
|
||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||
(upipay) => upipay?.UPIId === UpiId
|
||||
)
|
||||
(upipay) => upipay?.UPIId === UpiId
|
||||
)
|
||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pd')
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pd')
|
||||
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pg')
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pg')
|
||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||
: [],
|
||||
PaymentStatus:
|
||||
|
|
@ -2199,7 +2200,7 @@ const BSBillingTable5 = () => {
|
|||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? 'S'
|
||||
: 'P',
|
||||
Debit: 0,
|
||||
|
|
@ -2271,14 +2272,14 @@ const BSBillingTable5 = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
response?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2432,14 +2433,14 @@ const BSBillingTable5 = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
response?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2546,14 +2547,14 @@ const BSBillingTable5 = () => {
|
|||
}
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
if (response?.data?.OrderDetails?.length > 0) {
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2729,14 +2730,14 @@ const BSBillingTable5 = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
bookingpaymentupdate?.data?.response +
|
||||
' ' +
|
||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||
? bookingpaymentupdate?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
bookingpaymentupdate?.data?.OrderId,
|
||||
rbookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||
? bookingpaymentupdate?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
bookingpaymentupdate?.data?.OrderId,
|
||||
rbookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
bookingpaymentupdate?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([bookingpaymentupdate?.data]);
|
||||
|
|
@ -2755,7 +2756,7 @@ const BSBillingTable5 = () => {
|
|||
if (
|
||||
Date.now() - startTime >
|
||||
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
|
||||
60000
|
||||
60000
|
||||
) {
|
||||
// 60,000 ms = 1 minute
|
||||
|
||||
|
|
@ -3590,16 +3591,16 @@ const BSBillingTable5 = () => {
|
|||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 'none'
|
||||
: 'auto',
|
||||
opacity:
|
||||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 0.5
|
||||
: 1,
|
||||
}}
|
||||
|
|
@ -3610,10 +3611,10 @@ const BSBillingTable5 = () => {
|
|||
<button
|
||||
className={
|
||||
paybtnselected === payment.ModeId &&
|
||||
(UpinotSelected || CardoptionnotSelected)
|
||||
(UpinotSelected || CardoptionnotSelected)
|
||||
? 'Btn-payment-mode-notupisel'
|
||||
: paybtnselected === payment.ModeId &&
|
||||
(!UpinotSelected || !CardoptionnotSelected)
|
||||
(!UpinotSelected || !CardoptionnotSelected)
|
||||
? 'Btn-payment-mode'
|
||||
: 'Btn-payment-mode-sel'
|
||||
}
|
||||
|
|
@ -3627,13 +3628,13 @@ const BSBillingTable5 = () => {
|
|||
onClick={() =>
|
||||
payment?.ModeName?.toLowerCase() === 'upi' // Change the condition to payment.Id
|
||||
? handleUPIButtonClick(
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
: handlePaymentMode(
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
}
|
||||
>
|
||||
<div
|
||||
|
|
@ -3858,16 +3859,16 @@ const BSBillingTable5 = () => {
|
|||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 'none'
|
||||
: 'auto',
|
||||
opacity:
|
||||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 0.5
|
||||
: 1,
|
||||
width: '2rem',
|
||||
|
|
@ -3887,14 +3888,14 @@ const BSBillingTable5 = () => {
|
|||
width: '1.5rem',
|
||||
cursor:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'not-allowed'
|
||||
: 'pointer',
|
||||
color:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
display: 'flex',
|
||||
|
|
@ -3941,9 +3942,9 @@ const BSBillingTable5 = () => {
|
|||
OrderCardDetail?.length > 0 && 'not-allowed',
|
||||
color:
|
||||
OrderCardDetail?.length > 0 ||
|
||||
(selOption?.value === undefined &&
|
||||
GlobalAddCustomerDetails1?.length === 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
(selOption?.value === undefined &&
|
||||
GlobalAddCustomerDetails1?.length === 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
fontSize: '28px',
|
||||
|
|
@ -3956,7 +3957,40 @@ const BSBillingTable5 = () => {
|
|||
) : (
|
||||
''
|
||||
)}
|
||||
|
||||
{/* Customer Orders */}
|
||||
{GetCustId && (
|
||||
<Tooltip title="Customer Orders" isMobile={isMobile}>
|
||||
{' '}
|
||||
<div
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => {
|
||||
if (
|
||||
CheckBookingStatus !== 'Close' &&
|
||||
!addnewAccess &&
|
||||
!(OrderCardDetail?.length > 0)
|
||||
) {
|
||||
setCustomerPreviesOrders(true);
|
||||
}
|
||||
}}
|
||||
style={{
|
||||
cursor: OrderCardDetail?.length > 0 && 'not-allowed',
|
||||
color:
|
||||
OrderCardDetail?.length > 0 ||
|
||||
(OrderCardDetail?.length > 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
fontSize: '25px',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
height: '2.46rem',
|
||||
width: '1.5rem',
|
||||
}}
|
||||
>
|
||||
<FaCartPlus />
|
||||
</div>
|
||||
</Tooltip>
|
||||
)}
|
||||
{tabledata?.length > 0 && dinePreference && (
|
||||
<div style={{ width: '2rem' }}>
|
||||
{tableOptions
|
||||
|
|
@ -4000,14 +4034,14 @@ const BSBillingTable5 = () => {
|
|||
width: '1.5rem',
|
||||
cursor:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'not-allowed'
|
||||
: 'pointer',
|
||||
color:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
display: 'flex',
|
||||
|
|
@ -4057,28 +4091,28 @@ const BSBillingTable5 = () => {
|
|||
<>
|
||||
{unpaidFlow == false
|
||||
? item?.OptionName == 'Hold' &&
|
||||
!BookingTypeBoth &&
|
||||
BookingType !== 'Dine In' &&
|
||||
OrderCardDetail?.length != 0 &&
|
||||
CheckOrderType?.length === 0 &&
|
||||
OrderType != 'Failed' &&
|
||||
paybtns?.length > 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
||||
<button
|
||||
className="BSBIllingTable5-cnclbtn"
|
||||
onClick={() => AddBookingDetails('Hold')}
|
||||
style={{
|
||||
color: 'default',
|
||||
backgroundColor: '#eef3f3',
|
||||
}}
|
||||
>
|
||||
<p className="BigScreen">HOLD ✋</p>
|
||||
<span className="SmallScreen">✋</span>
|
||||
</button>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
!BookingTypeBoth &&
|
||||
BookingType !== 'Dine In' &&
|
||||
OrderCardDetail?.length != 0 &&
|
||||
CheckOrderType?.length === 0 &&
|
||||
OrderType != 'Failed' &&
|
||||
paybtns?.length > 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
||||
<button
|
||||
className="BSBIllingTable5-cnclbtn"
|
||||
onClick={() => AddBookingDetails('Hold')}
|
||||
style={{
|
||||
color: 'default',
|
||||
backgroundColor: '#eef3f3',
|
||||
}}
|
||||
>
|
||||
<p className="BigScreen">HOLD ✋</p>
|
||||
<span className="SmallScreen">✋</span>
|
||||
</button>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
: ''}
|
||||
{unpaidFlow === false &&
|
||||
item?.OptionName === 'Hold' &&
|
||||
|
|
@ -4117,9 +4151,9 @@ const BSBillingTable5 = () => {
|
|||
addnewAccess
|
||||
? 'BSBIllingTable5-paybtn-noitems-disable'
|
||||
: FirstPaymentclick === false &&
|
||||
OrderCardDetail?.length > 0 &&
|
||||
paybtnselected &&
|
||||
CheckBookingStatus != 'Close'
|
||||
OrderCardDetail?.length > 0 &&
|
||||
paybtnselected &&
|
||||
CheckBookingStatus != 'Close'
|
||||
? !OrderStatus
|
||||
? 'BSBIllingTable5-paybtn-noitems'
|
||||
: 'BSBIllingTable5-paybtn-noitems Order'
|
||||
|
|
@ -4370,14 +4404,14 @@ const BSBillingTable5 = () => {
|
|||
{(filteredSettingNames?.includes('Print') ||
|
||||
!MobileNoWhatsApp ||
|
||||
!MobileNoWhatsApp.value) && (
|
||||
<FaPrint
|
||||
size={32}
|
||||
color="#1292EE"
|
||||
style={{ cursor: 'pointer' }}
|
||||
onClick={handlePrintOrToken}
|
||||
title="Print"
|
||||
/>
|
||||
)}
|
||||
<FaPrint
|
||||
size={32}
|
||||
color="#1292EE"
|
||||
style={{ cursor: 'pointer' }}
|
||||
onClick={handlePrintOrToken}
|
||||
title="Print"
|
||||
/>
|
||||
)}
|
||||
|
||||
{filteredSettingNames?.includes('SMS') && isMobile && (
|
||||
<MdSms
|
||||
|
|
@ -4458,9 +4492,9 @@ const BSBillingTable5 = () => {
|
|||
|
||||
const qty = isGroup
|
||||
? OrderCardDetail.filter((o) => o.id === groupKey).reduce(
|
||||
(sum, o) => sum + (o.OrderQty || 1),
|
||||
0
|
||||
)
|
||||
(sum, o) => sum + (o.OrderQty || 1),
|
||||
0
|
||||
)
|
||||
: item.OrderQty || 1;
|
||||
|
||||
return (
|
||||
|
|
@ -4595,6 +4629,23 @@ const BSBillingTable5 = () => {
|
|||
Do you want to cancel the payment?
|
||||
</Modal>
|
||||
)}
|
||||
{customerPreviesOrders && (
|
||||
<DefaultModal
|
||||
open={customerPreviesOrders}
|
||||
handleCancel={() => setCustomerPreviesOrders(false)}
|
||||
footer={false}
|
||||
width={700}
|
||||
className={'ModalPaymentGatewayEmbedded'}
|
||||
children={
|
||||
<>
|
||||
<CustomerOrders
|
||||
CustomerDetails={selOption}
|
||||
close={() => setCustomerPreviesOrders(false)}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { AiOutlineClose, AiOutlineArrowRight } from 'react-icons/ai';
|
|||
import { Tables } from '../../../../../Components/Tables/Table';
|
||||
import { DefaultModal } from '../../../../../Components/Modal/DefaultModal.jsx';
|
||||
import { UpCircleOutlined, UpOutlined } from '@ant-design/icons';
|
||||
import { Popover, Badge, Modal } from 'antd';
|
||||
import { Popover, Badge, Modal, Tooltip } from 'antd';
|
||||
import {
|
||||
printDiv,
|
||||
extractLastNumberOrderId,
|
||||
|
|
@ -187,7 +187,7 @@ import { getCombolist } from '../../../../../Features/ComboMaster/ComboMaster.js
|
|||
import WhatsAppShare from '../../../../WhatsAppShare/whatsAppShare.jsx';
|
||||
import SMSShare from '../../../../WhatsAppShare/SmsShare.jsx';
|
||||
import { MdSms } from 'react-icons/md';
|
||||
import { FaWhatsapp, FaPrint } from 'react-icons/fa';
|
||||
import { FaWhatsapp, FaPrint, FaCartPlus } from 'react-icons/fa';
|
||||
import BSTipAmount from '../../UtillComponents/BSTipAmount.jsx';
|
||||
import { ApplicationPreferences } from '../../../../../Features/BrachLogin/BranchLogin.js';
|
||||
import { TfiClipboard } from 'react-icons/tfi';
|
||||
|
|
@ -211,6 +211,7 @@ import PaymentGatewayEmbedded from '../../UtillComponents/PaymentGatewayEmbedded
|
|||
import pozologoimg from '../../../../../Images/pozologoimg.png';
|
||||
import MobileMultiPdfPrintTrigger from '../../UtillComponents/MobileMultiPdfPrintTrigger.jsx';
|
||||
import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/DateStore.js';
|
||||
import CustomerOrders from '../../BookingFunctionality/CustomerOrders.jsx';
|
||||
|
||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
||||
|
|
@ -360,6 +361,7 @@ const BST6Payment = () => {
|
|||
const [UpiPayOption, setUpiPayOption] = useState([]);
|
||||
const [CardPayOption, setCardPayOption] = useState([]);
|
||||
const [Splitpayment, setSplitpayment] = useState(false);
|
||||
const [customerPreviesOrders, setCustomerPreviesOrders] = useState(false);
|
||||
|
||||
//Total calculation
|
||||
const [failedOrderData, setFailedOrderData] = useState();
|
||||
|
|
@ -671,7 +673,7 @@ const BST6Payment = () => {
|
|||
|
||||
const selectedStyle =
|
||||
stylesMap[
|
||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||
];
|
||||
|
||||
if (selectedStyle) {
|
||||
|
|
@ -2049,15 +2051,15 @@ const BST6Payment = () => {
|
|||
OrderStatus: 'O',
|
||||
OrderType:
|
||||
BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
Estimation?.SettingValue == 'N'
|
||||
BookingTypeBoth ||
|
||||
Estimation?.SettingValue == 'N'
|
||||
? 'S'
|
||||
: GlobEstBooking === 'OvrAllEst'
|
||||
? 'E'
|
||||
: GlobEstBooking === 'ParEst'
|
||||
? GlobProdwisedata?.includes(
|
||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||
)
|
||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||
)
|
||||
? 'E'
|
||||
: 'S'
|
||||
: 'S',
|
||||
|
|
@ -2147,7 +2149,7 @@ const BST6Payment = () => {
|
|||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? 'S'
|
||||
: 'P',
|
||||
OrderDtlDetails:
|
||||
|
|
@ -2164,9 +2166,9 @@ const BST6Payment = () => {
|
|||
? globalTipAmount === 0
|
||||
? SelectedTableDetails
|
||||
: SelectedTableDetails?.map((item) => ({
|
||||
...item,
|
||||
TipsAmount: globalTipAmount,
|
||||
}))
|
||||
...item,
|
||||
TipsAmount: globalTipAmount,
|
||||
}))
|
||||
: null,
|
||||
SalesPaymentType: 'normal',
|
||||
PaymentDetail: [
|
||||
|
|
@ -2179,8 +2181,8 @@ const BST6Payment = () => {
|
|||
? PaymentgatewayUPI?.[0]?.ModeId
|
||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find(
|
||||
(busupi) => busupi?.ModeId === UpiId
|
||||
)?.ModeId
|
||||
(busupi) => busupi?.ModeId === UpiId
|
||||
)?.ModeId
|
||||
: paybtnselected
|
||||
: paybtnselected
|
||||
? paybtnselected
|
||||
|
|
@ -2188,9 +2190,9 @@ const BST6Payment = () => {
|
|||
Amount: Math.round(TotalAmount),
|
||||
MerchantId:
|
||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||
?.MerchantId
|
||||
?.MerchantId
|
||||
: null,
|
||||
PaymentOptionType:
|
||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||
|
|
@ -2209,26 +2211,26 @@ const BST6Payment = () => {
|
|||
ModeOfPayment:
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||
?.UPIDetailId
|
||||
?.UPIDetailId
|
||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||
?.MerchantUPIId
|
||||
?.MerchantUPIId
|
||||
: null,
|
||||
AccountDtl:
|
||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||
(upipay) => upipay?.UPIId === UpiId
|
||||
)
|
||||
(upipay) => upipay?.UPIId === UpiId
|
||||
)
|
||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pd')
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pd')
|
||||
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pg')
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pg')
|
||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||
: [],
|
||||
PaymentStatus:
|
||||
|
|
@ -2237,7 +2239,7 @@ const BST6Payment = () => {
|
|||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? 'S'
|
||||
: 'P',
|
||||
Debit: 0,
|
||||
|
|
@ -2311,14 +2313,14 @@ const BST6Payment = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
response?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2474,14 +2476,14 @@ const BST6Payment = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
response?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2588,14 +2590,14 @@ const BST6Payment = () => {
|
|||
}
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
if (response?.data?.OrderDetails?.length > 0) {
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2771,14 +2773,14 @@ const BST6Payment = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
bookingpaymentupdate?.data?.response +
|
||||
' ' +
|
||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||
? bookingpaymentupdate?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
bookingpaymentupdate?.data?.OrderId,
|
||||
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||
? bookingpaymentupdate?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
bookingpaymentupdate?.data?.OrderId,
|
||||
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
bookingpaymentupdate?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([bookingpaymentupdate?.data]);
|
||||
|
|
@ -2797,7 +2799,7 @@ const BST6Payment = () => {
|
|||
if (
|
||||
Date.now() - startTime >
|
||||
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
|
||||
60000
|
||||
60000
|
||||
) {
|
||||
// 60,000 ms = 1 minute
|
||||
|
||||
|
|
@ -3497,59 +3499,59 @@ const BST6Payment = () => {
|
|||
<>
|
||||
{unpaidFlow == false
|
||||
? item?.OptionName == 'Hold' &&
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
OrderCardDetail?.length != 0 &&
|
||||
CheckOrderType?.length === 0 &&
|
||||
OrderType != 'Failed' &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
paybtns?.length > 0 &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
||||
{' '}
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => AddBookingDetails('Hold')}
|
||||
style={{
|
||||
fontSize: '30px',
|
||||
cursor: 'pointer',
|
||||
color: '' ? '#52c41a' : '#1292EE',
|
||||
}}
|
||||
/>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
OrderCardDetail?.length != 0 &&
|
||||
CheckOrderType?.length === 0 &&
|
||||
OrderType != 'Failed' &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
paybtns?.length > 0 &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
||||
{' '}
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => AddBookingDetails('Hold')}
|
||||
style={{
|
||||
fontSize: '30px',
|
||||
cursor: 'pointer',
|
||||
color: '' ? '#52c41a' : '#1292EE',
|
||||
}}
|
||||
/>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
: ''}
|
||||
{unpaidFlow == false
|
||||
? item?.OptionName == 'Hold' &&
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
Holddata?.length > 0 &&
|
||||
OrderCardDetail?.length == 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
!addnewAccess &&
|
||||
paybtns?.length > 0 &&
|
||||
!OtherServicesglobal && (
|
||||
<TooltipWrapper title={'Recall'} isMobile={isMobile}>
|
||||
{' '}
|
||||
<Badge
|
||||
count={Holddata?.length}
|
||||
size={'small'}
|
||||
offset={[0, 7]}
|
||||
>
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => HandleholdModelOpen()}
|
||||
style={{
|
||||
fontSize: '28px',
|
||||
cursor: 'pointer',
|
||||
color: Holddata ? '#52c41a' : 'default',
|
||||
pointerEvents:
|
||||
OrderType === 'Failed' ? 'none' : 'auto',
|
||||
}}
|
||||
/>
|
||||
</Badge>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
Holddata?.length > 0 &&
|
||||
OrderCardDetail?.length == 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
!addnewAccess &&
|
||||
paybtns?.length > 0 &&
|
||||
!OtherServicesglobal && (
|
||||
<TooltipWrapper title={'Recall'} isMobile={isMobile}>
|
||||
{' '}
|
||||
<Badge
|
||||
count={Holddata?.length}
|
||||
size={'small'}
|
||||
offset={[0, 7]}
|
||||
>
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => HandleholdModelOpen()}
|
||||
style={{
|
||||
fontSize: '28px',
|
||||
cursor: 'pointer',
|
||||
color: Holddata ? '#52c41a' : 'default',
|
||||
pointerEvents:
|
||||
OrderType === 'Failed' ? 'none' : 'auto',
|
||||
}}
|
||||
/>
|
||||
</Badge>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
: ''}
|
||||
</>
|
||||
))}
|
||||
|
|
@ -3560,16 +3562,16 @@ const BST6Payment = () => {
|
|||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 'none'
|
||||
: 'auto',
|
||||
opacity:
|
||||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 0.5
|
||||
: 1,
|
||||
width: '2rem',
|
||||
|
|
@ -3589,14 +3591,14 @@ const BST6Payment = () => {
|
|||
width: '1.5rem',
|
||||
cursor:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'not-allowed'
|
||||
: 'pointer',
|
||||
color:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
display: 'flex',
|
||||
|
|
@ -3662,16 +3664,16 @@ const BST6Payment = () => {
|
|||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 'none'
|
||||
: 'auto',
|
||||
opacity:
|
||||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 0.5
|
||||
: 1,
|
||||
}}
|
||||
|
|
@ -3682,10 +3684,10 @@ const BST6Payment = () => {
|
|||
<button
|
||||
className={
|
||||
paybtnselected === payment.ModeId &&
|
||||
(UpinotSelected || CardoptionnotSelected)
|
||||
(UpinotSelected || CardoptionnotSelected)
|
||||
? 'Btn-payment-mode-notupisel'
|
||||
: paybtnselected === payment.ModeId &&
|
||||
(!UpinotSelected || !CardoptionnotSelected)
|
||||
(!UpinotSelected || !CardoptionnotSelected)
|
||||
? 'Btn-payment-mode'
|
||||
: 'Btn-payment-mode-sel'
|
||||
}
|
||||
|
|
@ -3699,13 +3701,13 @@ const BST6Payment = () => {
|
|||
onClick={() =>
|
||||
payment?.ModeName?.toLowerCase() === 'upi' // Change the condition to payment.Id
|
||||
? handleUPIButtonClick(
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
: handlePaymentMode(
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
}
|
||||
>
|
||||
{/* {UpiOption === "" && payment?.Name?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
||||
|
|
@ -3777,9 +3779,9 @@ const BST6Payment = () => {
|
|||
addnewAccess
|
||||
? 'BST6Payment-Button-pay-disabled'
|
||||
: FirstPaymentclick === false &&
|
||||
OrderCardDetail?.length > 0 &&
|
||||
paybtnselected &&
|
||||
CheckBookingStatus != 'Close'
|
||||
OrderCardDetail?.length > 0 &&
|
||||
paybtnselected &&
|
||||
CheckBookingStatus != 'Close'
|
||||
? !OrderStatus
|
||||
? 'BST6Payment-Button-pay'
|
||||
: 'BST6Payment-Button-pay Order'
|
||||
|
|
@ -3941,9 +3943,9 @@ const BST6Payment = () => {
|
|||
>
|
||||
<div className="BST6Payment-buttons">
|
||||
{paybtnselected ==
|
||||
paybtns?.filter(
|
||||
(item) => item?.ModeName?.toLowerCase() === 'cash'
|
||||
)?.[0]?.ModeId ? (
|
||||
paybtns?.filter(
|
||||
(item) => item?.ModeName?.toLowerCase() === 'cash'
|
||||
)?.[0]?.ModeId ? (
|
||||
<PaymentInput
|
||||
totalAmount={TotalAmount}
|
||||
BillingTableName="BillingTable6"
|
||||
|
|
@ -3982,9 +3984,9 @@ const BST6Payment = () => {
|
|||
OrderCardDetail?.length > 0 && 'not-allowed',
|
||||
color:
|
||||
OrderCardDetail?.length > 0 ||
|
||||
(selOption?.value === undefined &&
|
||||
GlobalAddCustomerDetails1?.length === 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
(selOption?.value === undefined &&
|
||||
GlobalAddCustomerDetails1?.length === 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
fontSize: '28px',
|
||||
|
|
@ -3998,6 +4000,40 @@ const BST6Payment = () => {
|
|||
) : (
|
||||
''
|
||||
)}
|
||||
{/* Customer Orders */}
|
||||
{GetCustId && (
|
||||
<Tooltip title="Customer Orders" isMobile={isMobile}>
|
||||
{' '}
|
||||
<div
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => {
|
||||
if (
|
||||
CheckBookingStatus !== 'Close' &&
|
||||
!addnewAccess &&
|
||||
!(OrderCardDetail?.length > 0)
|
||||
) {
|
||||
setCustomerPreviesOrders(true);
|
||||
}
|
||||
}}
|
||||
style={{
|
||||
cursor: OrderCardDetail?.length > 0 && 'not-allowed',
|
||||
color:
|
||||
OrderCardDetail?.length > 0 ||
|
||||
(OrderCardDetail?.length > 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
fontSize: '25px',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
height: '2.46rem',
|
||||
width: '1.5rem',
|
||||
}}
|
||||
>
|
||||
<FaCartPlus />
|
||||
</div>
|
||||
</Tooltip>
|
||||
)}
|
||||
{tabledata?.length > 0 && dinePreference && (
|
||||
<div style={{ width: '2rem' }}>
|
||||
{tableOptions
|
||||
|
|
@ -4041,14 +4077,14 @@ const BST6Payment = () => {
|
|||
width: '1.5rem',
|
||||
cursor:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'not-allowed'
|
||||
: 'pointer',
|
||||
color:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
display: 'flex',
|
||||
|
|
@ -4388,9 +4424,9 @@ const BST6Payment = () => {
|
|||
|
||||
const qty = isGroup
|
||||
? OrderCardDetail.filter((o) => o.id === groupKey).reduce(
|
||||
(sum, o) => sum + (o.OrderQty || 1),
|
||||
0
|
||||
)
|
||||
(sum, o) => sum + (o.OrderQty || 1),
|
||||
0
|
||||
)
|
||||
: item.OrderQty || 1;
|
||||
|
||||
return (
|
||||
|
|
@ -4531,7 +4567,23 @@ const BST6Payment = () => {
|
|||
)
|
||||
// ))
|
||||
}
|
||||
|
||||
{customerPreviesOrders && (
|
||||
<DefaultModal
|
||||
open={customerPreviesOrders}
|
||||
handleCancel={() => setCustomerPreviesOrders(false)}
|
||||
footer={false}
|
||||
width={700}
|
||||
className={'ModalPaymentGatewayEmbedded'}
|
||||
children={
|
||||
<>
|
||||
<CustomerOrders
|
||||
CustomerDetails={selOption}
|
||||
close={() => setCustomerPreviesOrders(false)}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
<DefaultModal
|
||||
className={'paymentoptionsModal'}
|
||||
open={OtherServicesModal}
|
||||
|
|
@ -4561,9 +4613,9 @@ const BST6Payment = () => {
|
|||
|
||||
const qty = isGroup
|
||||
? OrderCardDetail.filter((o) => o.id === groupKey).reduce(
|
||||
(sum, o) => sum + (o.OrderQty || 1),
|
||||
0
|
||||
)
|
||||
(sum, o) => sum + (o.OrderQty || 1),
|
||||
0
|
||||
)
|
||||
: item.OrderQty || 1;
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import React, { useEffect, useState, useRef } from 'react';
|
|||
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import moment from 'moment';
|
||||
import { Badge, Popover, Modal } from 'antd';
|
||||
import { Badge, Popover, Modal, Tooltip } from 'antd';
|
||||
import { BiRightArrowAlt } from 'react-icons/bi';
|
||||
import { AiOutlineClose } from 'react-icons/ai';
|
||||
import BSSummery from '../BSBillingTableSummery/BSSummery.jsx';
|
||||
|
|
@ -185,7 +185,7 @@ import { getCombolist } from '../../../../../Features/ComboMaster/ComboMaster.js
|
|||
import WhatsAppShare from '../../../../WhatsAppShare/whatsAppShare.jsx';
|
||||
import SMSShare from '../../../../WhatsAppShare/SmsShare.jsx';
|
||||
import { MdSms } from 'react-icons/md';
|
||||
import { FaWhatsapp, FaPrint } from 'react-icons/fa';
|
||||
import { FaWhatsapp, FaPrint, FaCartPlus } from 'react-icons/fa';
|
||||
import BSTipAmount from '../../UtillComponents/BSTipAmount.jsx';
|
||||
import { ApplicationPreferences } from '../../../../../Features/BrachLogin/BranchLogin.js';
|
||||
import { TfiClipboard } from 'react-icons/tfi';
|
||||
|
|
@ -209,7 +209,7 @@ import pozologoimg from '../../../../../Images/pozologoimg.png';
|
|||
import PaymentGatewayEmbedded from '../../UtillComponents/PaymentGatewayEmbedded.jsx';
|
||||
import MobileMultiPdfPrintTrigger from '../../UtillComponents/MobileMultiPdfPrintTrigger.jsx';
|
||||
import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/DateStore.js';
|
||||
|
||||
import CustomerOrders from '../../BookingFunctionality/CustomerOrders.jsx';
|
||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
||||
const RetailApiurl = import.meta.env.ENV_API_URL;
|
||||
|
|
@ -329,7 +329,7 @@ const BSBilling7Payment = () => {
|
|||
const [hold, setHold] = useState(false);
|
||||
const [addcustomer, setAddCustomer] = useState(false);
|
||||
const [PrintOrderDetails, setPrintOrderDetails] = useState([]);
|
||||
const OverAllSales = useSelector(GlobalOverAllDiscSales);
|
||||
const [customerPreviesOrders, setCustomerPreviesOrders] = useState(false); const OverAllSales = useSelector(GlobalOverAllDiscSales);
|
||||
const OverAllEstimate = useSelector(GlobalOverAllDiscEstimate);
|
||||
//Total calculation
|
||||
const TotalItems = OrderCardDetail?.length;
|
||||
|
|
@ -810,7 +810,7 @@ const BSBilling7Payment = () => {
|
|||
|
||||
const selectedStyle =
|
||||
stylesMap[
|
||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||
];
|
||||
|
||||
if (selectedStyle) {
|
||||
|
|
@ -2016,15 +2016,15 @@ const BSBilling7Payment = () => {
|
|||
OrderStatus: 'O',
|
||||
OrderType:
|
||||
BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
Estimation?.SettingValue == 'N'
|
||||
BookingTypeBoth ||
|
||||
Estimation?.SettingValue == 'N'
|
||||
? 'S'
|
||||
: GlobEstBooking === 'OvrAllEst'
|
||||
? 'E'
|
||||
: GlobEstBooking === 'ParEst'
|
||||
? GlobProdwisedata?.includes(
|
||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||
)
|
||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||
)
|
||||
? 'E'
|
||||
: 'S'
|
||||
: 'S',
|
||||
|
|
@ -2115,7 +2115,7 @@ const BSBilling7Payment = () => {
|
|||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? 'S'
|
||||
: 'P',
|
||||
OrderDtlDetails:
|
||||
|
|
@ -2132,9 +2132,9 @@ const BSBilling7Payment = () => {
|
|||
? globalTipAmount === 0
|
||||
? SelectedTableDetails
|
||||
: SelectedTableDetails?.map((item) => ({
|
||||
...item,
|
||||
TipsAmount: globalTipAmount,
|
||||
}))
|
||||
...item,
|
||||
TipsAmount: globalTipAmount,
|
||||
}))
|
||||
: null,
|
||||
SalesPaymentType: 'normal',
|
||||
PaymentDetail: [
|
||||
|
|
@ -2147,8 +2147,8 @@ const BSBilling7Payment = () => {
|
|||
? PaymentgatewayUPI?.[0]?.ModeId
|
||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find(
|
||||
(busupi) => busupi?.ModeId === UpiId
|
||||
)?.ModeId
|
||||
(busupi) => busupi?.ModeId === UpiId
|
||||
)?.ModeId
|
||||
: paybtnselected
|
||||
: paybtnselected
|
||||
? paybtnselected
|
||||
|
|
@ -2156,9 +2156,9 @@ const BSBilling7Payment = () => {
|
|||
Amount: Math.round(TotalAmount),
|
||||
MerchantId:
|
||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||
?.MerchantId
|
||||
?.MerchantId
|
||||
: null,
|
||||
PaymentOptionType:
|
||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||
|
|
@ -2177,26 +2177,26 @@ const BSBilling7Payment = () => {
|
|||
ModeOfPayment:
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||
?.UPIDetailId
|
||||
?.UPIDetailId
|
||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||
?.MerchantUPIId
|
||||
?.MerchantUPIId
|
||||
: null,
|
||||
AccountDtl:
|
||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||
(upipay) => upipay?.UPIId === UpiId
|
||||
)
|
||||
(upipay) => upipay?.UPIId === UpiId
|
||||
)
|
||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pd')
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pd')
|
||||
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pg')
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pg')
|
||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||
: [],
|
||||
PaymentStatus:
|
||||
|
|
@ -2205,7 +2205,7 @@ const BSBilling7Payment = () => {
|
|||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? 'S'
|
||||
: 'P',
|
||||
Debit: 0,
|
||||
|
|
@ -2279,14 +2279,14 @@ const BSBilling7Payment = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
response?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2439,14 +2439,14 @@ const BSBilling7Payment = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
response?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2553,14 +2553,14 @@ const BSBilling7Payment = () => {
|
|||
}
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
if (response?.data?.OrderDetails?.length > 0) {
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2735,14 +2735,14 @@ const BSBilling7Payment = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
bookingpaymentupdate?.data?.response +
|
||||
' ' +
|
||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||
? bookingpaymentupdate?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
bookingpaymentupdate?.data?.OrderId,
|
||||
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||
? bookingpaymentupdate?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
bookingpaymentupdate?.data?.OrderId,
|
||||
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
bookingpaymentupdate?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([bookingpaymentupdate?.data]);
|
||||
|
|
@ -2761,7 +2761,7 @@ const BSBilling7Payment = () => {
|
|||
if (
|
||||
Date.now() - startTime >
|
||||
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
|
||||
60000
|
||||
60000
|
||||
) {
|
||||
// 60,000 ms = 1 minute
|
||||
|
||||
|
|
@ -3541,9 +3541,9 @@ const BSBilling7Payment = () => {
|
|||
OrderCardDetail?.length > 0 && 'not-allowed',
|
||||
color:
|
||||
OrderCardDetail?.length > 0 ||
|
||||
(selOption?.value === undefined &&
|
||||
GlobalAddCustomerDetails1?.length === 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
(selOption?.value === undefined &&
|
||||
GlobalAddCustomerDetails1?.length === 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
fontSize: '28px',
|
||||
|
|
@ -3556,6 +3556,41 @@ const BSBilling7Payment = () => {
|
|||
) : (
|
||||
''
|
||||
)}
|
||||
|
||||
{/* Customer Orders */}
|
||||
{GetCustId && (
|
||||
<Tooltip title="Customer Orders" isMobile={isMobile}>
|
||||
{' '}
|
||||
<div
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => {
|
||||
if (
|
||||
CheckBookingStatus !== 'Close' &&
|
||||
!addnewAccess &&
|
||||
!(OrderCardDetail?.length > 0)
|
||||
) {
|
||||
setCustomerPreviesOrders(true);
|
||||
}
|
||||
}}
|
||||
style={{
|
||||
cursor: OrderCardDetail?.length > 0 && 'not-allowed',
|
||||
color:
|
||||
OrderCardDetail?.length > 0 ||
|
||||
(OrderCardDetail?.length > 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
fontSize: '25px',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
height: '2.46rem',
|
||||
width: '1.5rem',
|
||||
}}
|
||||
>
|
||||
<FaCartPlus />
|
||||
</div>
|
||||
</Tooltip>
|
||||
)}
|
||||
{tabledata?.length > 0 && dinePreference && (
|
||||
<div style={{ width: '2rem' }}>
|
||||
{tableOptions
|
||||
|
|
@ -3592,16 +3627,16 @@ const BSBilling7Payment = () => {
|
|||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 'none'
|
||||
: 'auto',
|
||||
opacity:
|
||||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 0.5
|
||||
: 1,
|
||||
width: '2rem',
|
||||
|
|
@ -3621,14 +3656,14 @@ const BSBilling7Payment = () => {
|
|||
width: '1.5rem',
|
||||
cursor:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'not-allowed'
|
||||
: 'pointer',
|
||||
color:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
display: 'flex',
|
||||
|
|
@ -3656,14 +3691,14 @@ const BSBilling7Payment = () => {
|
|||
width: '1.5rem',
|
||||
cursor:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'not-allowed'
|
||||
: 'pointer',
|
||||
color:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
display: 'flex',
|
||||
|
|
@ -3713,59 +3748,59 @@ const BSBilling7Payment = () => {
|
|||
<>
|
||||
{unpaidFlow == false
|
||||
? item?.OptionName == 'Hold' &&
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
OrderCardDetail?.length != 0 &&
|
||||
OrderType != 'Failed' &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
paybtns?.length > 0 &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
||||
{' '}
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => AddBookingDetails('Hold')}
|
||||
style={{
|
||||
fontSize: '30px',
|
||||
cursor: 'pointer',
|
||||
color: '' ? '#52c41a' : '#1292EE',
|
||||
}}
|
||||
/>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
OrderCardDetail?.length != 0 &&
|
||||
OrderType != 'Failed' &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
paybtns?.length > 0 &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
||||
{' '}
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => AddBookingDetails('Hold')}
|
||||
style={{
|
||||
fontSize: '30px',
|
||||
cursor: 'pointer',
|
||||
color: '' ? '#52c41a' : '#1292EE',
|
||||
}}
|
||||
/>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
: ''}
|
||||
|
||||
{unpaidFlow == false
|
||||
? item?.OptionName == 'Hold' &&
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
Holddata?.length > 0 &&
|
||||
OrderCardDetail?.length == 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
paybtns?.length > 0 &&
|
||||
!addnewAccess &&
|
||||
!OtherServicesglobal && (
|
||||
<TooltipWrapper title={'Recall'} isMobile={isMobile}>
|
||||
{' '}
|
||||
<Badge
|
||||
count={Holddata?.length}
|
||||
size={'small'}
|
||||
offset={[0, 7]}
|
||||
>
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => HandleholdModelOpen()}
|
||||
style={{
|
||||
fontSize: '28px',
|
||||
cursor: 'pointer',
|
||||
color: Holddata ? '#52c41a' : 'default',
|
||||
pointerEvents:
|
||||
OrderType === 'Failed' ? 'none' : 'auto',
|
||||
}}
|
||||
/>
|
||||
</Badge>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
Holddata?.length > 0 &&
|
||||
OrderCardDetail?.length == 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
paybtns?.length > 0 &&
|
||||
!addnewAccess &&
|
||||
!OtherServicesglobal && (
|
||||
<TooltipWrapper title={'Recall'} isMobile={isMobile}>
|
||||
{' '}
|
||||
<Badge
|
||||
count={Holddata?.length}
|
||||
size={'small'}
|
||||
offset={[0, 7]}
|
||||
>
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => HandleholdModelOpen()}
|
||||
style={{
|
||||
fontSize: '28px',
|
||||
cursor: 'pointer',
|
||||
color: Holddata ? '#52c41a' : 'default',
|
||||
pointerEvents:
|
||||
OrderType === 'Failed' ? 'none' : 'auto',
|
||||
}}
|
||||
/>
|
||||
</Badge>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
: ''}
|
||||
</>
|
||||
))}
|
||||
|
|
@ -3791,16 +3826,16 @@ const BSBilling7Payment = () => {
|
|||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 'none'
|
||||
: 'auto',
|
||||
opacity:
|
||||
(BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
CheckOrderType?.length > 0) &&
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
!unpaidFlow &&
|
||||
OrderStatus
|
||||
? 0.5
|
||||
: 1,
|
||||
}}
|
||||
|
|
@ -3811,10 +3846,10 @@ const BSBilling7Payment = () => {
|
|||
<button
|
||||
className={
|
||||
paybtnselected === payment.ModeId &&
|
||||
(UpinotSelected || CardoptionnotSelected)
|
||||
(UpinotSelected || CardoptionnotSelected)
|
||||
? 'Btn-payment-mode-notupisel'
|
||||
: paybtnselected === payment.ModeId &&
|
||||
(!UpinotSelected || !CardoptionnotSelected)
|
||||
(!UpinotSelected || !CardoptionnotSelected)
|
||||
? 'Btn-payment-mode'
|
||||
: 'Btn-payment-mode-sel'
|
||||
}
|
||||
|
|
@ -3828,9 +3863,9 @@ const BSBilling7Payment = () => {
|
|||
onClick={() =>
|
||||
payment?.ModeName?.toLowerCase() === 'upi' // Change the condition to payment.Id
|
||||
? handleUPIButtonClick(
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
payment.ModeId,
|
||||
payment.ModeName
|
||||
)
|
||||
: handlePaymentMode(payment.ModeId, payment.ModeName)
|
||||
}
|
||||
>
|
||||
|
|
@ -4116,9 +4151,9 @@ const BSBilling7Payment = () => {
|
|||
addnewAccess
|
||||
? 'Table4-Btn-final-price-disabled'
|
||||
: FirstPaymentclick === false &&
|
||||
OrderCardDetail?.length > 0 &&
|
||||
paybtnselected &&
|
||||
CheckBookingStatus != 'Close'
|
||||
OrderCardDetail?.length > 0 &&
|
||||
paybtnselected &&
|
||||
CheckBookingStatus != 'Close'
|
||||
? !OrderStatus
|
||||
? 'Table4-Btn-final-price'
|
||||
: 'Table4-Btn-final-price Order'
|
||||
|
|
@ -4139,7 +4174,7 @@ const BSBilling7Payment = () => {
|
|||
<div
|
||||
className="Table4-rate"
|
||||
style={{ fontFamily: FontFamily['head'] }}
|
||||
// onClick={() => AddBookingDetails(BookingType, true)}
|
||||
// onClick={() => AddBookingDetails(BookingType, true)}
|
||||
>
|
||||
{/* ₹ {Math.round(TotalAmount)} */}
|
||||
{isMobile ? (
|
||||
|
|
@ -4344,9 +4379,9 @@ const BSBilling7Payment = () => {
|
|||
|
||||
const qty = isGroup
|
||||
? OrderCardDetail.filter((o) => o.id === groupKey).reduce(
|
||||
(sum, o) => sum + (o.OrderQty || 1),
|
||||
0
|
||||
)
|
||||
(sum, o) => sum + (o.OrderQty || 1),
|
||||
0
|
||||
)
|
||||
: item.OrderQty || 1;
|
||||
|
||||
return (
|
||||
|
|
@ -4438,8 +4473,8 @@ const BSBilling7Payment = () => {
|
|||
columns={columns}
|
||||
data={TableData}
|
||||
dataSource={TableData}
|
||||
// pagination={handlePageChange}
|
||||
// onChange={handleChange}
|
||||
// pagination={handlePageChange}
|
||||
// onChange={handleChange}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
|
|
@ -4544,9 +4579,9 @@ const BSBilling7Payment = () => {
|
|||
|
||||
const qty = isGroup
|
||||
? OrderCardDetail.filter((o) => o.id === groupKey).reduce(
|
||||
(sum, o) => sum + (o.OrderQty || 1),
|
||||
0
|
||||
)
|
||||
(sum, o) => sum + (o.OrderQty || 1),
|
||||
0
|
||||
)
|
||||
: item.OrderQty || 1;
|
||||
|
||||
return (
|
||||
|
|
@ -4638,6 +4673,23 @@ const BSBilling7Payment = () => {
|
|||
Do you want to cancel the payment?
|
||||
</Modal>
|
||||
)}
|
||||
{customerPreviesOrders && (
|
||||
<DefaultModal
|
||||
open={customerPreviesOrders}
|
||||
handleCancel={() => setCustomerPreviesOrders(false)}
|
||||
footer={false}
|
||||
width={700}
|
||||
className={'ModalPaymentGatewayEmbedded'}
|
||||
children={
|
||||
<>
|
||||
<CustomerOrders
|
||||
CustomerDetails={selOption}
|
||||
close={() => setCustomerPreviesOrders(false)}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import {
|
||||
FaAngleDown,
|
||||
FaCartPlus,
|
||||
FaMoneyBillWave,
|
||||
FaPrint,
|
||||
FaWhatsapp,
|
||||
|
|
@ -200,6 +201,7 @@ import {
|
|||
getLowStockAlertProductsList,
|
||||
} from '../../../../../Features/ProductPage/ProductPage.js';
|
||||
import { PostBlockSlots } from '../../../../../Features/Kiosk/kiosk.js';
|
||||
import CustomerOrders from '../../BookingFunctionality/CustomerOrders.jsx';
|
||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
||||
const RetailApiurl = import.meta.env.ENV_API_URL;
|
||||
|
|
@ -342,6 +344,7 @@ const StandardTablePayment = () => {
|
|||
const [showCancelConfirm, setShowCancelConfirm] = useState(false);
|
||||
const [creditCustomerOpen, setcreditCustomerOpen] = useState(false);
|
||||
const [Splitpayment, setSplitpayment] = useState(false);
|
||||
const [customerPreviesOrders, setCustomerPreviesOrders] = useState(false);
|
||||
const [PrintOrderDetails, setPrintOrderDetails] = useState([]);
|
||||
const [PaymentUpiOptions, setPaymentUpiOptions] = useState([]);
|
||||
const [PaymentDeviceCard, setPaymentDeviceCard] = useState([]);
|
||||
|
|
@ -1358,15 +1361,15 @@ const StandardTablePayment = () => {
|
|||
OrderStatus: 'O',
|
||||
OrderType:
|
||||
BookingType === 'Dine In' ||
|
||||
BookingTypeBoth ||
|
||||
Estimation?.SettingValue == 'N'
|
||||
BookingTypeBoth ||
|
||||
Estimation?.SettingValue == 'N'
|
||||
? 'S'
|
||||
: GlobEstBooking === 'OvrAllEst'
|
||||
? 'E'
|
||||
: GlobEstBooking === 'ParEst'
|
||||
? GlobProdwisedata?.includes(
|
||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||
)
|
||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||
)
|
||||
? 'E'
|
||||
: 'S'
|
||||
: 'S',
|
||||
|
|
@ -1462,7 +1465,7 @@ const StandardTablePayment = () => {
|
|||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? 'S'
|
||||
: 'P',
|
||||
OrderDtlDetails:
|
||||
|
|
@ -1479,9 +1482,9 @@ const StandardTablePayment = () => {
|
|||
? globalTipAmount === 0
|
||||
? SelectedTableDetails
|
||||
: SelectedTableDetails?.map((item) => ({
|
||||
...item,
|
||||
TipsAmount: globalTipAmount,
|
||||
}))
|
||||
...item,
|
||||
TipsAmount: globalTipAmount,
|
||||
}))
|
||||
: null,
|
||||
|
||||
SalesPaymentType: 'normal',
|
||||
|
|
@ -1495,8 +1498,8 @@ const StandardTablePayment = () => {
|
|||
? PaymentgatewayUPI?.[0]?.ModeId
|
||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find(
|
||||
(busupi) => busupi?.ModeId === UpiId
|
||||
)?.ModeId
|
||||
(busupi) => busupi?.ModeId === UpiId
|
||||
)?.ModeId
|
||||
: paybtnselected
|
||||
: paybtnselected
|
||||
? paybtnselected
|
||||
|
|
@ -1504,9 +1507,9 @@ const StandardTablePayment = () => {
|
|||
Amount: Math.round(TotalAmount),
|
||||
MerchantId:
|
||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||
?.MerchantId
|
||||
?.MerchantId
|
||||
: null,
|
||||
PaymentOptionType:
|
||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||
|
|
@ -1525,26 +1528,26 @@ const StandardTablePayment = () => {
|
|||
ModeOfPayment:
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||
?.UPIDetailId
|
||||
?.UPIDetailId
|
||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||
?.MerchantUPIId
|
||||
?.MerchantUPIId
|
||||
: null,
|
||||
AccountDtl:
|
||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||
(upipay) => upipay?.UPIId === UpiId
|
||||
)
|
||||
(upipay) => upipay?.UPIId === UpiId
|
||||
)
|
||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pd')
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pd')
|
||||
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pg')
|
||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||
SelectedCardOption?.toLowerCase() === 'pg')
|
||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||
: [],
|
||||
PaymentStatus:
|
||||
|
|
@ -1553,7 +1556,7 @@ const StandardTablePayment = () => {
|
|||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? 'S'
|
||||
: 'P',
|
||||
Debit: 0,
|
||||
|
|
@ -1652,14 +1655,14 @@ const StandardTablePayment = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
response?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -1813,14 +1816,14 @@ const StandardTablePayment = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
response?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -1923,14 +1926,14 @@ const StandardTablePayment = () => {
|
|||
}
|
||||
setMessageData(
|
||||
response?.data?.response +
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(response?.data?.OrderDetails?.length > 0
|
||||
? response?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
response?.data?.OrderId,
|
||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
if (response?.data?.OrderDetails?.length > 0) {
|
||||
setPrintOrderDetails([response?.data]);
|
||||
|
|
@ -2000,9 +2003,9 @@ const StandardTablePayment = () => {
|
|||
AppId: AppId,
|
||||
...(AvailableDate && selectedDate
|
||||
? {
|
||||
fromDate: selectedDate?.[0],
|
||||
toDate: selectedDate?.[1],
|
||||
}
|
||||
fromDate: selectedDate?.[0],
|
||||
toDate: selectedDate?.[1],
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
await dispatch(getSelectedFavItems(data)).unwrap();
|
||||
|
|
@ -2014,9 +2017,9 @@ const StandardTablePayment = () => {
|
|||
ProdSubCat: ProdSubCat,
|
||||
...(AvailableDate && selectedDate
|
||||
? {
|
||||
fromDate: selectedDate?.[0],
|
||||
toDate: selectedDate?.[1],
|
||||
}
|
||||
fromDate: selectedDate?.[0],
|
||||
toDate: selectedDate?.[1],
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
|
||||
|
|
@ -2027,9 +2030,9 @@ const StandardTablePayment = () => {
|
|||
prodCat: prodCat,
|
||||
...(AvailableDate && selectedDate
|
||||
? {
|
||||
fromDate: selectedDate?.[0],
|
||||
toDate: selectedDate?.[1],
|
||||
}
|
||||
fromDate: selectedDate?.[0],
|
||||
toDate: selectedDate?.[1],
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
|
||||
|
|
@ -2209,14 +2212,14 @@ const StandardTablePayment = () => {
|
|||
setMessageType('success');
|
||||
setMessageData(
|
||||
bookingpaymentupdate?.data?.response +
|
||||
' ' +
|
||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||
? bookingpaymentupdate?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
bookingpaymentupdate?.data?.OrderId,
|
||||
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
' ' +
|
||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||
? bookingpaymentupdate?.data?.OrderId &&
|
||||
extractLastNumberOrderId(
|
||||
bookingpaymentupdate?.data?.OrderId,
|
||||
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||
)
|
||||
: '')
|
||||
);
|
||||
bookingpaymentupdate?.data?.OrderDetails?.length > 0 &&
|
||||
setPrintOrderDetails([bookingpaymentupdate?.data]);
|
||||
|
|
@ -2234,7 +2237,7 @@ const StandardTablePayment = () => {
|
|||
if (
|
||||
Date.now() - startTime >
|
||||
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
|
||||
60000
|
||||
60000
|
||||
) {
|
||||
// 60,000 ms = 1 minute
|
||||
|
||||
|
|
@ -2881,7 +2884,7 @@ const StandardTablePayment = () => {
|
|||
|
||||
const selectedStyle =
|
||||
stylesMap[
|
||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||
];
|
||||
|
||||
if (selectedStyle) {
|
||||
|
|
@ -3365,9 +3368,9 @@ const StandardTablePayment = () => {
|
|||
(acc, data) => parseFloat(data?.TotalAmt || 0) + acc,
|
||||
0
|
||||
) -
|
||||
((OverAllSales > 0 ? OverAllSales : 0) +
|
||||
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
||||
(Discount > 0 ? Discount : 0))
|
||||
((OverAllSales > 0 ? OverAllSales : 0) +
|
||||
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
||||
(Discount > 0 ? Discount : 0))
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -3385,9 +3388,9 @@ const StandardTablePayment = () => {
|
|||
cursor: orderCardDetail?.length > 0 && 'not-allowed',
|
||||
color:
|
||||
orderCardDetail?.length > 0 ||
|
||||
(selOption?.value === undefined &&
|
||||
GlobalAddCustomerDetails1?.length === 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
(selOption?.value === undefined &&
|
||||
GlobalAddCustomerDetails1?.length === 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
fontSize: '28px',
|
||||
|
|
@ -3410,14 +3413,14 @@ const StandardTablePayment = () => {
|
|||
width: '1.5rem',
|
||||
cursor:
|
||||
orderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'not-allowed'
|
||||
: 'pointer',
|
||||
color:
|
||||
orderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
display: 'flex',
|
||||
|
|
@ -3430,6 +3433,42 @@ const StandardTablePayment = () => {
|
|||
</Tooltip>
|
||||
)}
|
||||
|
||||
{/* Customer Orders */}
|
||||
{GetCustId && (
|
||||
|
||||
<Tooltip title="Customer Orders" isMobile={isMobile}>
|
||||
{' '}
|
||||
<div
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => {
|
||||
if (
|
||||
CheckBookingStatus !== 'Close' &&
|
||||
!addnewAccess &&
|
||||
!(orderCardDetail?.length > 0)
|
||||
) {
|
||||
setCustomerPreviesOrders(true);
|
||||
}
|
||||
}}
|
||||
style={{
|
||||
cursor: orderCardDetail?.length > 0 && 'not-allowed',
|
||||
color:
|
||||
orderCardDetail?.length > 0 ||
|
||||
(orderCardDetail?.length > 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
? 'gray'
|
||||
: 'rgb(18, 146, 238)',
|
||||
fontSize: '25px',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
height: '2.46rem',
|
||||
width: '1.5rem',
|
||||
}}
|
||||
>
|
||||
<FaCartPlus />
|
||||
</div>
|
||||
</Tooltip>
|
||||
)}
|
||||
|
||||
{tabledata?.length > 0 && dinePreference && (
|
||||
<div style={{ width: '2rem' }}>
|
||||
{tableOptions
|
||||
|
|
@ -3486,14 +3525,14 @@ const StandardTablePayment = () => {
|
|||
{(filteredSettingNames?.includes('Print') ||
|
||||
!MobileNoWhatsApp ||
|
||||
!MobileNoWhatsApp.value) && (
|
||||
<FaPrint
|
||||
size={32}
|
||||
color="#1292EE"
|
||||
style={{ cursor: 'pointer' }}
|
||||
onClick={handlePrintOrToken}
|
||||
title="Print"
|
||||
/>
|
||||
)}
|
||||
<FaPrint
|
||||
size={32}
|
||||
color="#1292EE"
|
||||
style={{ cursor: 'pointer' }}
|
||||
onClick={handlePrintOrToken}
|
||||
title="Print"
|
||||
/>
|
||||
)}
|
||||
|
||||
{filteredSettingNames?.includes('SMS') && isMobile && (
|
||||
<MdSms
|
||||
|
|
@ -3582,7 +3621,7 @@ const StandardTablePayment = () => {
|
|||
const handleClick =
|
||||
mode === 'upi'
|
||||
? () =>
|
||||
handleUPIButtonClick(payment?.ModeId, payment?.ModeName)
|
||||
handleUPIButtonClick(payment?.ModeId, payment?.ModeName)
|
||||
: () => handlePaymentMode(payment?.ModeId, payment?.ModeName);
|
||||
|
||||
return (
|
||||
|
|
@ -3679,9 +3718,9 @@ const StandardTablePayment = () => {
|
|||
addnewAccess
|
||||
? 'standard-pay-btn-disabled'
|
||||
: FirstPaymentclick === false &&
|
||||
orderCardDetail?.length > 0 &&
|
||||
paybtnselected &&
|
||||
CheckBookingStatus !== 'Close'
|
||||
orderCardDetail?.length > 0 &&
|
||||
paybtnselected &&
|
||||
CheckBookingStatus !== 'Close'
|
||||
? !OrderStatus
|
||||
? 'standard-pay-btn'
|
||||
: 'standard-pay-btn order-complete'
|
||||
|
|
@ -3745,8 +3784,8 @@ const StandardTablePayment = () => {
|
|||
columns={columns}
|
||||
data={TableData}
|
||||
dataSource={TableData}
|
||||
// pagination={handlePageChange}
|
||||
// onChange={handleChange}
|
||||
// pagination={handlePageChange}
|
||||
// onChange={handleChange}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
|
|
@ -3911,11 +3950,11 @@ const StandardTablePayment = () => {
|
|||
handlesplitpaymentclose={handlesplitpaymentclose}
|
||||
TotalNetAmount={Math.round(
|
||||
orderCardDetail?.reduce((acc, data) => data?.TotalAmt + acc, 0) -
|
||||
((OverAllSales > 0 ? OverAllSales : 0) +
|
||||
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
||||
(Discount > 0 ? Discount : 0))
|
||||
((OverAllSales > 0 ? OverAllSales : 0) +
|
||||
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
||||
(Discount > 0 ? Discount : 0))
|
||||
)}
|
||||
// failedOrderData={failedOrderData}
|
||||
// failedOrderData={failedOrderData}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
|
@ -3975,6 +4014,23 @@ const StandardTablePayment = () => {
|
|||
Do you want to cancel the payment?
|
||||
</Modal>
|
||||
)}
|
||||
{customerPreviesOrders && (
|
||||
<DefaultModal
|
||||
open={customerPreviesOrders}
|
||||
handleCancel={() => setCustomerPreviesOrders(false)}
|
||||
footer={false}
|
||||
width={700}
|
||||
className={'ModalPaymentGatewayEmbedded'}
|
||||
children={
|
||||
<>
|
||||
<CustomerOrders
|
||||
CustomerDetails={selOption}
|
||||
close={() => setCustomerPreviesOrders(false)}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{
|
||||
OtherServicesPrintDetails?.length > 0 && (
|
||||
// PrintOrderDetails?.[0]?.OrderDetails?.map((orderDetail, index) => (
|
||||
|
|
|
|||
|
|
@ -0,0 +1,339 @@
|
|||
import { useDispatch } from "react-redux";
|
||||
import { changeOrderCardDetails, CustomerOrderList, getProductsearch } from "../../../../Features/BookingScreen/BookingData/BookingData";
|
||||
import { useEffect, useState } from "react";
|
||||
import { ExtractDateFormate, getSession } from "../../../../Services/Others";
|
||||
import { Tables } from "../../../../Components/Tables/Table";
|
||||
import { IoEye } from "react-icons/io5";
|
||||
import { DatePicker, Modal } from "antd";
|
||||
import dayjs from "dayjs";
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
const CustomerOrders = ({ CustomerDetails, close }) => {
|
||||
|
||||
const CompId = getSession('CompId');
|
||||
const BranchId = getSession('BranchId');
|
||||
const AppId = getSession('AppId');
|
||||
const { RangePicker } = DatePicker;
|
||||
const dispatch = useDispatch();
|
||||
const [custpmerOrderData, setCustpmerOrderData] = useState();
|
||||
console.log(CustomerDetails, 'CustomerDetails');
|
||||
|
||||
const [page, setpage] = useState(1);
|
||||
const [selectedProducts, setSelectedProducts] = useState();
|
||||
const [productModal, setProductModal] = useState(false);
|
||||
const [selectedRange, setSelectedRange] = useState([dayjs(), dayjs()]);
|
||||
|
||||
useEffect(() => {
|
||||
setSelectedRange([dayjs(), dayjs()]);
|
||||
customerFetch();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (selectedRange && selectedRange[0] && selectedRange[1]) {
|
||||
customerFetch();
|
||||
}
|
||||
}, [selectedRange]);
|
||||
|
||||
const getApiRange = () => {
|
||||
if (!selectedRange || !selectedRange[0] || !selectedRange[1]) return { fromDate: '', toDate: '' };
|
||||
|
||||
return {
|
||||
fromDate: selectedRange[0].format('YYYY-MM-DD'),
|
||||
toDate: selectedRange[1].format('YYYY-MM-DD'),
|
||||
};
|
||||
};
|
||||
|
||||
const customerFetch = async () => {
|
||||
const { fromDate, toDate } = getApiRange();
|
||||
const data = {
|
||||
AppId: AppId,
|
||||
BranchId: BranchId,
|
||||
CompId: CompId,
|
||||
MobileNo: CustomerDetails?.value,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate,
|
||||
}
|
||||
const response = await dispatch(CustomerOrderList(data)).unwrap();
|
||||
if (response?.data?.statusCode === 1) {
|
||||
setCustpmerOrderData(response?.data?.data)
|
||||
}
|
||||
else {
|
||||
setCustpmerOrderData()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
const ViewProductdetails = (products) => {
|
||||
setSelectedProducts(products);
|
||||
setProductModal(true);
|
||||
};
|
||||
const handlePageChange = (current) => {
|
||||
setpage(current);
|
||||
};
|
||||
// const handleRowDataClick = (record) => {
|
||||
// dispatch(changeOrderCardDetails(record?.productDetails));
|
||||
// close();
|
||||
// };
|
||||
|
||||
|
||||
|
||||
const getProductsearchData = async (prodName) => {
|
||||
const data = {
|
||||
CompId,
|
||||
BranchId,
|
||||
AppId,
|
||||
ProdName: prodName
|
||||
}
|
||||
const response = await dispatch(getProductsearch(data)).unwrap();
|
||||
console.log(response, 'response23232323');
|
||||
|
||||
}
|
||||
|
||||
const handleRowDataClick = (record) => {
|
||||
if (!record?.productDetails?.length) return;
|
||||
const prodName = record.productDetails[0]?.ProdName;
|
||||
getProductsearchData(prodName);
|
||||
|
||||
console.log(record.productDetails[0]?.ProdName, 'record?.productDetails');
|
||||
|
||||
const formattedData = record.productDetails.map((prod) => ({
|
||||
ProdCat: prod.ProdCat,
|
||||
Type: prod.Type,
|
||||
|
||||
OverallQuantity: prod.OverallQuantity ?? 0,
|
||||
ActiveStatus: record.ActiveStatus,
|
||||
|
||||
AvailableFrom: prod.AvailableFrom,
|
||||
AvailableTo: prod.AvailableTo,
|
||||
|
||||
Cess: prod.Cess ?? 0,
|
||||
HSNCode: prod.HSN ?? null,
|
||||
|
||||
BrandName: prod.BrandName ?? null,
|
||||
OpeningQty: prod.OpeningQty ?? 0,
|
||||
PartNumber: prod.PartNumber ?? null,
|
||||
|
||||
ProdId: prod.ProdId,
|
||||
ProdLogo: prod.ProdLogo ?? null,
|
||||
ProdName: prod.ProdName,
|
||||
|
||||
QRCode: prod.QRCode ?? null,
|
||||
QtyBasedPrice: prod.QtyBasedPrice ?? null,
|
||||
Rack: prod.Rack ?? null,
|
||||
Size: prod.Size,
|
||||
|
||||
StockAvailable: prod.StockAvailable ?? null,
|
||||
TokenAvailable: prod.TokenAvailable ?? null,
|
||||
|
||||
TaxId: prod.ProdTaxId ?? null,
|
||||
TaxPercentage: prod.ProdTaxPercentage ?? 0,
|
||||
TaxName: prod.TaxName ?? null,
|
||||
|
||||
UniqueId: prod.UniqueId ?? null,
|
||||
UomName: prod.UomName,
|
||||
|
||||
SinglePc: prod.SinglePc ?? null,
|
||||
NoOfPcs: prod.NoOfPcs ?? 0,
|
||||
|
||||
ProdVariantName: prod.ProdVariantName ?? null,
|
||||
VariantAvailableFrom: prod.VariantAvailableFrom ?? null,
|
||||
VariantAvailableTo: prod.VariantAvailableTo ?? null,
|
||||
|
||||
BalanceQty: prod.BalanceQty ?? 0,
|
||||
BatchRef: prod.BatchRef ?? null,
|
||||
|
||||
FullProductIdentifierDtls: prod.ProductIdentifierDtls ?? [],
|
||||
|
||||
InwardDate: prod.BookingDate ?? null,
|
||||
InwardDtlId: prod.InwardDtlId ?? null,
|
||||
InwardId: prod.InwardId ?? null,
|
||||
|
||||
MRP: prod.MRP ?? 0,
|
||||
OrderRate: prod.Rate ?? 0,
|
||||
SellingPrice: prod.Rate ?? 0,
|
||||
|
||||
SuppId: prod.SuppId ?? null,
|
||||
SuppName: prod.SuppName ?? null,
|
||||
|
||||
OverAllPcs: prod.OverAllPcs ?? 0,
|
||||
Offer: prod.OfferAmt ?? 0,
|
||||
|
||||
BookingTypeName: prod.BookingTypeName ?? null,
|
||||
CounterName: prod.CounterName ?? null,
|
||||
|
||||
DiscountLimitType: prod.DiscountLimitType ?? null,
|
||||
DiscountLimit: prod.DiscountLimit ?? 0,
|
||||
|
||||
BookedDate: prod.BookedDate ?? [],
|
||||
BalanceBookedQty: prod.BalanceBookedQty ?? null,
|
||||
|
||||
ScaleType: prod.ScaleType ?? "",
|
||||
|
||||
localId: prod.localId ?? uuidv4(),
|
||||
|
||||
OrderQty: prod.SalesQty ?? 0,
|
||||
TotalAmt: prod.TotalAmt ?? 0,
|
||||
TaxAmt: prod.TaxAmt ?? 0,
|
||||
WithoutTaxRate: prod.WithoutTaxRate ?? 0,
|
||||
}));
|
||||
|
||||
dispatch(changeOrderCardDetails(formattedData));
|
||||
close();
|
||||
};
|
||||
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'Sl.No',
|
||||
key: 'sno',
|
||||
align: 'center',
|
||||
render: (_, __, index) => (page - 1) * 10 + index + 1,
|
||||
onCell: (record) => ({
|
||||
onClick: () => handleRowDataClick(record),
|
||||
style: { cursor: 'pointer' },
|
||||
}),
|
||||
},
|
||||
{
|
||||
title: 'Sales Date',
|
||||
dataIndex: 'SalesDate',
|
||||
key: 'SalesDate',
|
||||
align: 'center',
|
||||
render: (text) => ExtractDateFormate(text),
|
||||
onCell: (record) => ({
|
||||
onClick: () => handleRowDataClick(record),
|
||||
style: { cursor: 'pointer' },
|
||||
}),
|
||||
},
|
||||
{
|
||||
title: 'Amount',
|
||||
dataIndex: 'NetAmount',
|
||||
key: 'NetAmount',
|
||||
align: 'center',
|
||||
onCell: (record) => ({
|
||||
onClick: () => handleRowDataClick(record),
|
||||
style: { cursor: 'pointer' },
|
||||
}),
|
||||
},
|
||||
|
||||
{
|
||||
title: 'No of Products',
|
||||
key: 'productCount',
|
||||
align: 'center',
|
||||
render: (_, record) => (
|
||||
<span
|
||||
style={{ color: '#1292EE', fontSize: '16px', cursor: 'pointer' }}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation(); // 👈 IMPORTANT
|
||||
ViewProductdetails(record.productDetails);
|
||||
}}
|
||||
>
|
||||
{record?.productDetails?.length || 0}
|
||||
</span>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
const productColumns = [
|
||||
{
|
||||
title: 'Sl.No',
|
||||
key: 'sno',
|
||||
align: 'center',
|
||||
render: (_, __, index) => index + 1,
|
||||
},
|
||||
{
|
||||
title: 'Product Name',
|
||||
dataIndex: 'ProdName',
|
||||
key: 'ProdName',
|
||||
align: 'center',
|
||||
render: (_, record) =>
|
||||
`${record?.ProdName || '-'}${record?.UomName ? ` ${record.Size + record.UomName}` : ''}`,
|
||||
},
|
||||
{
|
||||
title: 'Qty',
|
||||
dataIndex: 'SalesQty',
|
||||
key: 'SalesQty',
|
||||
align: 'center',
|
||||
render: (_, record) =>
|
||||
record?.SalesQty || '-',
|
||||
},
|
||||
{
|
||||
title: 'Variant',
|
||||
key: 'ProdVariantName',
|
||||
align: 'ProdVariantName',
|
||||
render: (_, record) =>
|
||||
record?.ProdVariantName || '-',
|
||||
},
|
||||
{
|
||||
title: 'Rate',
|
||||
key: 'Rate',
|
||||
align: 'right',
|
||||
render: (_, record) =>
|
||||
record?.Rate || 0,
|
||||
},
|
||||
{
|
||||
title: 'MRP',
|
||||
key: 'MRP',
|
||||
align: 'right',
|
||||
render: (_, record) =>
|
||||
record?.MRP || 0,
|
||||
},
|
||||
];
|
||||
|
||||
const disableFutureDates = (current) => {
|
||||
return current && current > dayjs().endOf('day');
|
||||
};
|
||||
const onRangeChange = (dates) => {
|
||||
setSelectedRange(dates);
|
||||
};
|
||||
const getRangePickerValue = () => selectedRange || [dayjs(), dayjs()];
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
<div>
|
||||
<p>Customer Name : {CustomerDetails?.CustName}</p>
|
||||
<p>Customer Name : {CustomerDetails?.value}</p>
|
||||
</div>
|
||||
<div className='fromlabelDate'>
|
||||
<label>Select Date</label>
|
||||
<RangePicker
|
||||
onChange={onRangeChange}
|
||||
format="DD-MMM-YYYY" // display format
|
||||
disabledDate={disableFutureDates}
|
||||
inputReadOnly={true}
|
||||
value={getRangePickerValue()}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="reportTable">
|
||||
<Tables
|
||||
columns={columns}
|
||||
data={custpmerOrderData}
|
||||
dataSource={custpmerOrderData}
|
||||
pagination={handlePageChange}
|
||||
/>{' '}
|
||||
|
||||
|
||||
<Modal
|
||||
open={productModal}
|
||||
title="Product Details"
|
||||
width={700}
|
||||
footer={null}
|
||||
onCancel={() => setProductModal(false)}
|
||||
>
|
||||
<Tables
|
||||
columns={productColumns}
|
||||
data={selectedProducts}
|
||||
pagination={false}
|
||||
/>
|
||||
</Modal>
|
||||
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default CustomerOrders;
|
||||
|
|
@ -82,11 +82,11 @@ const CardPage1 = (props) => {
|
|||
(cartItem) =>
|
||||
cartItem?.ProdId === item?.ProductDetail?.[0]?.ProdId &&
|
||||
cartItem?.InwardDtlId ===
|
||||
item?.ProductDetail?.[0]?.ProdVariantDetails?.[0]?.StockDetails?.[0]
|
||||
?.InwardDtlId &&
|
||||
item?.ProductDetail?.[0]?.ProdVariantDetails?.[0]?.StockDetails?.[0]
|
||||
?.InwardDtlId &&
|
||||
cartItem?.OrderRate ===
|
||||
item?.ProductDetail?.[0]?.ProdVariantDetails?.[0]?.StockDetails?.[0]
|
||||
?.SellPrice
|
||||
item?.ProductDetail?.[0]?.ProdVariantDetails?.[0]?.StockDetails?.[0]
|
||||
?.SellPrice
|
||||
);
|
||||
if (Isincart && Isincart?.StockAvailable === 'Y') {
|
||||
if (Isincart?.BalanceQty > Isincart?.OrderQty) {
|
||||
|
|
@ -141,13 +141,13 @@ const CardPage1 = (props) => {
|
|||
(cartItem) =>
|
||||
cartItem?.ProdId === qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdId &&
|
||||
cartItem?.InwardDtlId ===
|
||||
qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[
|
||||
item?.VarientIndex
|
||||
]?.StockDetails?.[0]?.InwardDtlId &&
|
||||
qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[
|
||||
item?.VarientIndex
|
||||
]?.StockDetails?.[0]?.InwardDtlId &&
|
||||
cartItem?.OrderRate ===
|
||||
qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[
|
||||
item?.VarientIndex
|
||||
]?.StockDetails?.[0]?.SellPrice
|
||||
qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[
|
||||
item?.VarientIndex
|
||||
]?.StockDetails?.[0]?.SellPrice
|
||||
);
|
||||
console.log(Isincart, item, KioskOrderDetails, 'IsincartsingleVarient');
|
||||
if (Isincart && Isincart?.StockAvailable === 'Y') {
|
||||
|
|
@ -236,7 +236,7 @@ const CardPage1 = (props) => {
|
|||
SinglePc: onePcs ? 'Y' : 'N',
|
||||
NoOfPcs: onePcs
|
||||
? a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||
?.StockDetails?.[stockIndex]?.NoOfPcs
|
||||
?.StockDetails?.[stockIndex]?.NoOfPcs
|
||||
: null,
|
||||
ProdVariantName:
|
||||
a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||
|
|
@ -261,14 +261,14 @@ const CardPage1 = (props) => {
|
|||
?.StockDetails?.[stockIndex]?.InwardId,
|
||||
MRP: onePcs
|
||||
? a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||
?.StockDetails?.[stockIndex]?.OnePcsPrice
|
||||
?.StockDetails?.[stockIndex]?.OnePcsPrice
|
||||
: a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||
?.StockDetails?.[stockIndex]?.MRP,
|
||||
?.StockDetails?.[stockIndex]?.MRP,
|
||||
OrderRate: onePcs
|
||||
? a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||
?.StockDetails?.[stockIndex]?.OnePcsPrice
|
||||
?.StockDetails?.[stockIndex]?.OnePcsPrice
|
||||
: a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||
?.StockDetails?.[stockIndex]?.SellPrice,
|
||||
?.StockDetails?.[stockIndex]?.SellPrice,
|
||||
SuppId:
|
||||
a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||
?.StockDetails?.[stockIndex]?.SuppId,
|
||||
|
|
@ -312,28 +312,28 @@ const CardPage1 = (props) => {
|
|||
cartItem // if the item is already in the cart, increase the quantity of the item
|
||||
) =>
|
||||
cartItem.ProdId === item.ProdId &&
|
||||
cartItem.InwardDtlId === item.InwardDtlId &&
|
||||
cartItem.OrderRate === item.OrderRate &&
|
||||
cartItem?.BookingTypeName === item?.BookingTypeName
|
||||
cartItem.InwardDtlId === item.InwardDtlId &&
|
||||
cartItem.OrderRate === item.OrderRate &&
|
||||
cartItem?.BookingTypeName === item?.BookingTypeName
|
||||
? {
|
||||
...cartItem,
|
||||
OrderQty: cartItem.OrderQty + 1,
|
||||
TotalAmt: (cartItem.OrderQty + 1) * cartItem.OrderRate,
|
||||
TaxAmt: (
|
||||
...cartItem,
|
||||
OrderQty: cartItem.OrderQty + 1,
|
||||
TotalAmt: (cartItem.OrderQty + 1) * cartItem.OrderRate,
|
||||
TaxAmt: (
|
||||
((cartItem.OrderQty + 1) *
|
||||
cartItem.OrderRate *
|
||||
cartItem.TaxPercentage) /
|
||||
(100 + cartItem.TaxPercentage)
|
||||
).toFixed(2),
|
||||
WithoutTaxRate:
|
||||
(cartItem.OrderQty + 1) * cartItem.OrderRate -
|
||||
(
|
||||
((cartItem.OrderQty + 1) *
|
||||
cartItem.OrderRate *
|
||||
cartItem.TaxPercentage) /
|
||||
(100 + cartItem.TaxPercentage)
|
||||
).toFixed(2),
|
||||
WithoutTaxRate:
|
||||
(cartItem.OrderQty + 1) * cartItem.OrderRate -
|
||||
(
|
||||
((cartItem.OrderQty + 1) *
|
||||
cartItem.OrderRate *
|
||||
cartItem.TaxPercentage) /
|
||||
(100 + cartItem.TaxPercentage)
|
||||
).toFixed(2),
|
||||
}
|
||||
}
|
||||
: cartItem // otherwise, return the cart item
|
||||
)
|
||||
)
|
||||
|
|
@ -520,9 +520,9 @@ const CardPage1 = (props) => {
|
|||
card?.OverAllQty,
|
||||
KioskOrderDetails
|
||||
) > 0) ||
|
||||
card?.ProductDetail?.some(
|
||||
(item) => item?.StockAvailable !== 'Y'
|
||||
)
|
||||
card?.ProductDetail?.some(
|
||||
(item) => item?.StockAvailable !== 'Y'
|
||||
)
|
||||
? 'KioskCard-card'
|
||||
: 'KioskCard-card-dis'
|
||||
}
|
||||
|
|
@ -550,9 +550,9 @@ const CardPage1 = (props) => {
|
|||
card?.OverAllQty,
|
||||
KioskOrderDetails
|
||||
) > 0) ||
|
||||
card?.ProductDetail?.some(
|
||||
(item) => item?.StockAvailable !== 'Y'
|
||||
) ? (
|
||||
card?.ProductDetail?.some(
|
||||
(item) => item?.StockAvailable !== 'Y'
|
||||
) ? (
|
||||
''
|
||||
) : (
|
||||
<div
|
||||
|
|
@ -574,18 +574,18 @@ const CardPage1 = (props) => {
|
|||
card?.ProductDetail?.some(
|
||||
(item) => item?.StockAvailable !== 'Y'
|
||||
)) && (
|
||||
<div className="dishPrize">
|
||||
<p>
|
||||
<MdCurrencyRupee
|
||||
style={{ marginBottom: '-2px', marginRight: '-5px' }}
|
||||
/>{' '}
|
||||
{ItemSellingPrice(card)}
|
||||
<span className="BSItemCard-itemCount">
|
||||
({ItemSize(card)} {ItemUomName(card)})
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
<div className="dishPrize">
|
||||
<p>
|
||||
<MdCurrencyRupee
|
||||
style={{ marginBottom: '-2px', marginRight: '-5px' }}
|
||||
/>{' '}
|
||||
{ItemSellingPrice(card)}
|
||||
<span className="BSItemCard-itemCount">
|
||||
({ItemSize(card)} {ItemUomName(card)})
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
|
|
@ -737,7 +737,7 @@ const CardPage1 = (props) => {
|
|||
KioskOrderDetails,
|
||||
item?.ProdVariantName
|
||||
) > 0 ||
|
||||
qtydata?.ProductDetail?.[QtyIndex]?.StockAvailable !== 'Y'
|
||||
qtydata?.ProductDetail?.[QtyIndex]?.StockAvailable !== 'Y'
|
||||
? 'ProVariantCard'
|
||||
: 'ProVariantCard-dis'
|
||||
}
|
||||
|
|
@ -752,7 +752,7 @@ const CardPage1 = (props) => {
|
|||
KioskOrderDetails,
|
||||
item?.ProdVariantName
|
||||
) > 0 ||
|
||||
qtydata?.ProductDetail?.[QtyIndex]?.StockAvailable !==
|
||||
qtydata?.ProductDetail?.[QtyIndex]?.StockAvailable !==
|
||||
'Y' ? (
|
||||
<div>₹ {item?.StockDetails?.[0]?.SellPrice} </div>
|
||||
) : (
|
||||
|
|
|
|||
4692
src/check.jsx
4692
src/check.jsx
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue