Payment option issue
This commit is contained in:
parent
2094f326dd
commit
d5f89327d1
|
|
@ -1590,7 +1590,7 @@ const BSC1Payment = (props) => {
|
|||
|
||||
const selectedStyle =
|
||||
stylesMap[
|
||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||
];
|
||||
|
||||
if (selectedStyle) {
|
||||
|
|
@ -1969,15 +1969,15 @@ const BSC1Payment = (props) => {
|
|||
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',
|
||||
|
|
@ -2059,7 +2059,7 @@ const BSC1Payment = (props) => {
|
|||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? 'S'
|
||||
: 'P',
|
||||
OrderDtlDetails:
|
||||
|
|
@ -2076,9 +2076,9 @@ const BSC1Payment = (props) => {
|
|||
? globalTipAmount === 0
|
||||
? SelectedTableDetails
|
||||
: SelectedTableDetails?.map((item) => ({
|
||||
...item,
|
||||
TipsAmount: globalTipAmount,
|
||||
}))
|
||||
...item,
|
||||
TipsAmount: globalTipAmount,
|
||||
}))
|
||||
: null,
|
||||
// "Credit": TotalAmount,
|
||||
// "Debit": 0,
|
||||
|
|
@ -2112,23 +2112,23 @@ const BSC1Payment = (props) => {
|
|||
ModeOfPayment:
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||
?.UPIDetailId
|
||||
?.UPIDetailId
|
||||
: 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:
|
||||
|
|
@ -2137,7 +2137,7 @@ const BSC1Payment = (props) => {
|
|||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? 'S'
|
||||
: 'P',
|
||||
Debit: 0,
|
||||
|
|
@ -2196,14 +2196,14 @@ const BSC1Payment = (props) => {
|
|||
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]);
|
||||
|
|
@ -2347,14 +2347,14 @@ const BSC1Payment = (props) => {
|
|||
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]);
|
||||
|
|
@ -2456,14 +2456,14 @@ const BSC1Payment = (props) => {
|
|||
}
|
||||
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]);
|
||||
|
|
@ -2560,14 +2560,14 @@ const BSC1Payment = (props) => {
|
|||
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]);
|
||||
|
|
@ -2585,7 +2585,7 @@ const BSC1Payment = (props) => {
|
|||
if (
|
||||
Date.now() - startTime >
|
||||
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
|
||||
60000
|
||||
60000
|
||||
) {
|
||||
// 60,000 ms = 1 minute
|
||||
|
||||
|
|
@ -3599,16 +3599,16 @@ const BSC1Payment = (props) => {
|
|||
(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,
|
||||
}}
|
||||
|
|
@ -3619,10 +3619,10 @@ const BSC1Payment = (props) => {
|
|||
<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'
|
||||
}
|
||||
|
|
@ -3700,16 +3700,16 @@ const BSC1Payment = (props) => {
|
|||
(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,
|
||||
}}
|
||||
|
|
@ -3729,14 +3729,14 @@ const BSC1Payment = (props) => {
|
|||
style={{
|
||||
cursor:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? 'not-allowed'
|
||||
: 'pointer',
|
||||
color:
|
||||
OrderCardDetail?.length === 0 ||
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
CheckBookingStatus == 'Close' ||
|
||||
addnewAccess
|
||||
? '#fff'
|
||||
: '#ffffffff',
|
||||
alignItems: 'center',
|
||||
|
|
@ -3832,19 +3832,61 @@ const BSC1Payment = (props) => {
|
|||
{/* {item?.OptionName=="Hold" && */}
|
||||
{unpaidFlow == false
|
||||
? item?.OptionName == 'Hold' &&
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
OrderCardDetail?.length != 0 &&
|
||||
CheckOrderType?.length === 0 &&
|
||||
OrderType != 'Failed' &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
||||
{' '}
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
OrderCardDetail?.length != 0 &&
|
||||
CheckOrderType?.length === 0 &&
|
||||
OrderType != 'Failed' &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
||||
{' '}
|
||||
<div
|
||||
style={{
|
||||
backgroundColor: '' ? '#52c41a' : '#1292EE',
|
||||
color: '' ? '#52c41a' : '#ffffffff',
|
||||
height: '40px',
|
||||
width: '45px',
|
||||
borderRadius: '6px',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
padding: '8px 8px 12px 8px',
|
||||
}}
|
||||
>
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => AddBookingDetails('Hold')}
|
||||
style={{
|
||||
cursor: 'pointer',
|
||||
// color: '' ? '#52c41a' : '#1292EE',
|
||||
}}
|
||||
/>{' '}
|
||||
{/* <p className="payOptionDecition"> Hold</p> */}
|
||||
</div>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
: ''}
|
||||
|
||||
{unpaidFlow == false
|
||||
? item?.OptionName == 'Hold' &&
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
Holddata?.length > 0 &&
|
||||
OrderCardDetail?.length == 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper title={'Recall'} isMobile={isMobile}>
|
||||
{' '}
|
||||
<Badge
|
||||
count={Holddata?.length}
|
||||
size={'small'}
|
||||
offset={[0, 7]}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
backgroundColor: '' ? '#52c41a' : '#1292EE',
|
||||
color: '' ? '#52c41a' : '#ffffffff',
|
||||
backgroundColor: Holddata ? '#52c41a' : 'default',
|
||||
color: Holddata ? '#ffffffff' : 'default',
|
||||
height: '40px',
|
||||
width: '45px',
|
||||
borderRadius: '6px',
|
||||
|
|
@ -3856,60 +3898,18 @@ const BSC1Payment = (props) => {
|
|||
>
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => AddBookingDetails('Hold')}
|
||||
onClick={() => HandleholdModelOpen()}
|
||||
style={{
|
||||
cursor: 'pointer',
|
||||
// color: '' ? '#52c41a' : '#1292EE',
|
||||
// color: Holddata ? '#52c41a' : 'default',
|
||||
pointerEvents:
|
||||
OrderType === 'Failed' ? 'none' : 'auto',
|
||||
}}
|
||||
/>{' '}
|
||||
{/* <p className="payOptionDecition"> Hold</p> */}
|
||||
/>
|
||||
</div>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
: ''}
|
||||
|
||||
{unpaidFlow == false
|
||||
? item?.OptionName == 'Hold' &&
|
||||
BookingType !== 'Dine In' &&
|
||||
!BookingTypeBoth &&
|
||||
Holddata?.length > 0 &&
|
||||
OrderCardDetail?.length == 0 &&
|
||||
CheckBookingStatus != 'Close' &&
|
||||
!addnewAccess && (
|
||||
<TooltipWrapper title={'Recall'} isMobile={isMobile}>
|
||||
{' '}
|
||||
<Badge
|
||||
count={Holddata?.length}
|
||||
size={'small'}
|
||||
offset={[0, 7]}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
backgroundColor: Holddata ? '#52c41a' : 'default',
|
||||
color: Holddata ? '#ffffffff' : 'default',
|
||||
height: '40px',
|
||||
width: '45px',
|
||||
borderRadius: '6px',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
padding: '8px 8px 12px 8px',
|
||||
}}
|
||||
>
|
||||
<PozoHoldIcon
|
||||
className="BSBillingNav-icon-table-icon"
|
||||
onClick={() => HandleholdModelOpen()}
|
||||
style={{
|
||||
cursor: 'pointer',
|
||||
// color: Holddata ? '#52c41a' : 'default',
|
||||
pointerEvents:
|
||||
OrderType === 'Failed' ? 'none' : 'auto',
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Badge>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
</Badge>
|
||||
</TooltipWrapper>
|
||||
)
|
||||
: ''}
|
||||
{tabledata?.length > 0 && dinePreference && (
|
||||
<>
|
||||
|
|
@ -3978,9 +3978,9 @@ const BSC1Payment = (props) => {
|
|||
style={{
|
||||
backgroundColor:
|
||||
OrderCardDetail?.length > 0 ||
|
||||
(selOption?.value === undefined &&
|
||||
GlobalAddCustomerDetails1?.length === 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
(selOption?.value === undefined &&
|
||||
GlobalAddCustomerDetails1?.length === 0 &&
|
||||
GetCustId?.CustMobile === undefined)
|
||||
? 'gray'
|
||||
: '#1292eeff',
|
||||
color: '#fff',
|
||||
|
|
@ -4023,36 +4023,36 @@ const BSC1Payment = (props) => {
|
|||
{FeatureAddonData?.FeatureDtls?.find(
|
||||
(item) => item?.FeatureAddonName?.toLowerCase() === 'preorder'
|
||||
) && (
|
||||
<>
|
||||
{
|
||||
<div
|
||||
style={{
|
||||
pointerEvents:
|
||||
OrderCardDetail?.length > 0 || OrderType === 'Failed'
|
||||
? 'none'
|
||||
: 'auto',
|
||||
opacity: OrderCardDetail?.length > 0 ? 0.5 : 1,
|
||||
}}
|
||||
>
|
||||
<TooltipWrapper title={'Pre Order'} isMobile={isMobile}>
|
||||
<Badge
|
||||
count={preOrderPendingCount}
|
||||
offset={[-5, 10]}
|
||||
size="small"
|
||||
>
|
||||
<PozoPreOrderIcon
|
||||
className="BSBillingNav-icon"
|
||||
fill={preOrderOpen ? '#52C41A' : '#1292EE'}
|
||||
onClick={() => {
|
||||
openPreOrder();
|
||||
}}
|
||||
/>
|
||||
</Badge>
|
||||
</TooltipWrapper>
|
||||
</div>
|
||||
}
|
||||
</>
|
||||
)}
|
||||
<>
|
||||
{
|
||||
<div
|
||||
style={{
|
||||
pointerEvents:
|
||||
OrderCardDetail?.length > 0 || OrderType === 'Failed'
|
||||
? 'none'
|
||||
: 'auto',
|
||||
opacity: OrderCardDetail?.length > 0 ? 0.5 : 1,
|
||||
}}
|
||||
>
|
||||
<TooltipWrapper title={'Pre Order'} isMobile={isMobile}>
|
||||
<Badge
|
||||
count={preOrderPendingCount}
|
||||
offset={[-5, 10]}
|
||||
size="small"
|
||||
>
|
||||
<PozoPreOrderIcon
|
||||
className="BSBillingNav-icon"
|
||||
fill={preOrderOpen ? '#52C41A' : '#1292EE'}
|
||||
onClick={() => {
|
||||
openPreOrder();
|
||||
}}
|
||||
/>
|
||||
</Badge>
|
||||
</TooltipWrapper>
|
||||
</div>
|
||||
}
|
||||
</>
|
||||
)}
|
||||
{preOrderOpen && <BSNavBarPreOrder />}
|
||||
{sportsAppPreference && <BSMembership />}
|
||||
{dinePreference &&
|
||||
|
|
@ -4210,9 +4210,9 @@ const BSC1Payment = (props) => {
|
|||
addnewAccess
|
||||
? 'BSC1Payment-div4-button-disable'
|
||||
: FirstPaymentclick === false &&
|
||||
OrderCardDetail?.length > 0 &&
|
||||
paybtnselected &&
|
||||
CheckBookingStatus != 'Close'
|
||||
OrderCardDetail?.length > 0 &&
|
||||
paybtnselected &&
|
||||
CheckBookingStatus != 'Close'
|
||||
? !OrderStatus
|
||||
? 'BSC1Payment-div4-button'
|
||||
: 'BSC1Payment-div4-button Order'
|
||||
|
|
@ -4441,8 +4441,8 @@ const BSC1Payment = (props) => {
|
|||
columns={columns}
|
||||
data={TableData}
|
||||
dataSource={TableData}
|
||||
// pagination={handlePageChange}
|
||||
// onChange={handleChange}
|
||||
// pagination={handlePageChange}
|
||||
// onChange={handleChange}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
|
|
@ -4537,6 +4537,7 @@ const BSC1Payment = (props) => {
|
|||
open={GlobalSalesPaymentoptions}
|
||||
width={500}
|
||||
height={1000}
|
||||
destroyOnClose={true}
|
||||
handleCancel={() => {
|
||||
dispatch(changeSalesPaymentoption(false));
|
||||
}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue